Quote:Original post by ZedFx
Taken from the windows header files
*** Source Snippet Removed ***
as you can see __int64 is the same as LARGE_INTEGER
Yes. I didn't say it was wrong. Hum. Well. As for today, it is true. But if I have a look to a particular implementation of the STL I'll have überl33t hints to find new way to use my vector. Is it a good idea ?
When an API gives you an abstracted data type to use, it is actually better to use it. Moreover, I think it is actually a very bad idea to tell a beginner to use what I might call "a hack". I don't call it a hack because it is bad, I call it like this because it assumes the knowledge of the internals of the API you are using (in this case, you had to search though the windows header to find it. It is not documented anywhere. A LARGE_INTEGER resolves to a LONGLONG or to a struct, not to a __int64).
Plus, you had to add those casts everwhere to enable everything to compile. Will they work if they go to __int128 when they'll release longhorn?
Quote:Original post by ZedFx
so why use __int64 ?
-> because MSVC++ 7 has built in support for __int64
what does this mean ?
-> it means we can multiply and divide it safely in the function I detailed above
what if I dont have MSVC++ 7
-> then it is not necessary to use __int64, but you will have to implement the division and multiplication yourself
I hope their is support for LONGLONG as well :) More seriously, No offense but this cannot be an argument. Because VC7 supports __int64, I have to use it instead of an abstracted type? If I use gcc then LONGLONG is a typedef to long long. Should I change all my code? Should I make two version of my code to compile on both compiler? Just because they have support for a particular, non standard buitin type?
Hope you get my point, regards,