|
-
Feb 28th, 2005, 11:11 AM
#1
Thread Starter
Fanatic Member
C to C#
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
-
Feb 28th, 2005, 05:03 PM
#2
Re: C to C#
 Originally Posted by birthjay
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#
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 ...
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Mar 1st, 2005, 08:16 AM
#3
Thread Starter
Fanatic Member
Re: C to C#
Thanks...
What does this one mean?
Code:
#define CW_CCW_OPT 0x0040
-
Mar 1st, 2005, 09:55 AM
#4
New Member
Re: C to C#
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.
-
Mar 1st, 2005, 01:40 PM
#5
Re: C to C#
 Originally Posted by birthjay
Thanks...
What does this one mean?
Code:
#define CW_CCW_OPT 0x0040
It's a preprocessor.
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
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Mar 2nd, 2005, 08:59 AM
#6
Sleep mode
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 .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|