I have just seen in the Winsock.h file that there is and "unsigned char" data type. for Aurora to use char it is an "unsigned byte". How would we use "unsigned char"? im guessing its not "unsigned unsigned byte" ;)
Lewis
Nevermind i managed to find it in the SDK. so for anyone else wondering, an unsigned char is just a byte. Maybe that was obvious for others but not for me.
Lewis
He .. He .. :)ÂÃ, the only negative character I ever came across was a human kind ..
Graham :)
unsigned char = unsigned byte
char = byte
Although I prefer char = unsigned byte.
ohh. i have been using unsigned byte as char. not just byte. Maybe that is the problem i am having with my MD5 hash algorithm. hmm. worth a try.
Lewis
In hashing it's really picky if the operations depend on what the sign bit is being used for. In standard ASCII text, they only use 7 bits to designate the text, so either would work for normal text, but there are some times when you have to be careful with it.
In C anything can be signed or unsigned, with the default left up to the writer of the compiler. So signed char is the same as byte in Aurora, signed int is the same as int, unsigned int is the same in Aurora, etc. Just for reference, short = word, long = a 32 bit quantity, I think int may vary based on whether or not the system is 32 or 64 bit. __int64 is always 64 bit in microsoft compilers at least, float and double are the same, they can't have the signed or unsigned prefix. I think long long is also 64 bit, and there's a long double too, which I think is 10 byte, but I may be wrong.
float = 32 bit
double = 64 bit
In both aurora and C
I guess I wasn't very clear on that, I meant to say that they had the same type names in both languages, not that they were the same type. Sorry
And then the Intel compiler has all kinds of weird datatypes for MMX, SSE, etc. But that's all confusing for me.
still a bit confused (maybe not) - tried for an hour to get a little program to run until I found out that the data type "char" is not available.
Am I correct in my reading of this forum thread that:
char = unsigned byte (is there a signed byte and if so, does a signed byte = char, I don't think so)
float = 32 bit (4 byte) ?
double = 64 bit (8 byte) ?
In C there are no rules on whether a type defaults to signed or unsigned, so they have both of those keywords for you to distinguish. In Aurora they are all signed unless you specify unsigned.
Since an ASCII character normally only uses 7 bits (there are some 8 bit systems though), it shouldn't matter too much whether you use byte or unsigned byte. But I always use unsigned byte.
Yes, float is 32 bit and double is 64 bit.