#define from c++ to c#

  • Thread starter Thread starter AMP
  • Start date Start date
A

AMP

I have all these #define commands in a c++ file I am converting to C#.
They usually have a value assigned to them:
#define BSL_TXBLK 0x12

What is the c# equivalent for this.
(It wont accept these,I dont think)
"Cannot define/undefine preproccessor symbols after first token in
file"

Thanks,
Mike
 
Hello AMP,

use const/readonly statements

A> I have all these #define commands in a c++ file I am converting to
A> C#.
A> They usually have a value assigned to them:
A> #define BSL_TXBLK 0x12
A> What is the c# equivalent for this.
A> (It wont accept these,I dont think)
A> "Cannot define/undefine preproccessor symbols after first token in
A> file"
A> Thanks,
A> Mike
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
It's just const. Read only statements would imply that the value can be
changed at run time, which is a different semantic than a #define statement
in C++.
 
Hello Nicholas Paldino [.NET/C# MVP],

yep. Should be more specific.

N> It's just const. Read only statements would imply that the value
N> can be changed at run time, which is a different semantic than a
N> #define statement in C++.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Back
Top