I'm afraid I do not know much about C...so how would I change this to C#?
Code:#define MACH_2P 0
#define MACH_STCPL 1
#define UNQ_2P 2
#define UNQ_STCPL 3
Printable View
I'm afraid I do not know much about C...so how would I change this to C#?
Code:#define MACH_2P 0
#define MACH_STCPL 1
#define UNQ_2P 2
#define UNQ_STCPL 3
apparenly its not used like that in C#Quote:
Originally Posted by birthjay
http://msdn.microsoft.com/library/de...clrfdefine.asp
if you use #define you cant really assign anything to it.
Why dont you just declare constants instead?
const int MACH_STPCL = 1 ...
Thanks...
What does this one mean?
Code:#define CW_CCW_OPT 0x0040
The 0x in front indicates that it is a hexadecimal (base 16) number. It's equivalent 64 in decimal. You should be able to use a const int just fine with that value.
It's a preprocessor.Quote:
Originally Posted by birthjay
basically when you use #define in C/C++, the compiler actually modifies your source code before compilation and REPLACES all the preprocessors with the numbers you've assigned to them. So when you compile your code, anywhere that you use CW_CCW_OPT, the compiler replaces it with the value of 0x0040 and THEN compiles your code.
Im not sure, maybe there is a way to do it in C# as well
Public const is the proper translation . The only difference is when you define a preprocessor like that in C it's file scoped but in C# if it's public then it's global to the whole app .