C# Convention Question
I use C# quite a bit (basically except on projects where the language is defined by the project) and I have yet to use the System.Int*, System.Double, etc. definitions. They''re there because they exist, but there is never a need to use them.
quote:Original post by haro
I''d assume that int would reference the most logical integer data type for the particular architecture that your code is running on. For a 64 bit architecture this would most likely be a 64 bit value, as opposed to a 32.
Assume nothing.
If I may recommend, if you want integer aliasing that is platform dependent you can use the preprocessor to define them.
#if PLATFORM_64
using size_t = System.UInt64;
#else
using size_t = System.UInt32;
#endif
Of course when doing this you need to be aware of what the different requirements do to your program, but there are reasons to want this behavior.
#if PLATFORM_64
using size_t = System.UInt64;
#else
using size_t = System.UInt32;
#endif
Of course when doing this you need to be aware of what the different requirements do to your program, but there are reasons to want this behavior.
quote:Original post by levendis
If I may recommend, if you want integer aliasing that is platform dependent you can use the preprocessor to define them.
#if PLATFORM_64
using size_t = System.UInt64;
#else
using size_t = System.UInt32;
#endif
Of course when doing this you need to be aware of what the different requirements do to your program, but there are reasons to want this behavior.
System.IntPtr?
[How To Ask Questions|STL Programmer''s Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement