#define from c++ to c#

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
 
M

Michael Nemtsev

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
 
N

Nicholas Paldino [.NET/C# MVP]

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++.
 
M

Michael Nemtsev

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top