-
variables
I am learning C and I have an issue about the defining of variables which I think is more because of my book than my lack of understanding. In one of the program listings the book defins a variable called "money". From the rest of the program it is clearly an unsigned int but in the definition it just says:
unsigned money;
i but it compiles ok. Am I to assume that it assumes the variable is an int unless stated i.e. that unsigned money; is equivalent to unsigned int money;
thanks if you can shed some light on this
Matt
-
When typing unsigned the compiler understands that you mean an unsigned int. The same with long, which is translated to long int. This is most likely to save time and space, though I prefer to print the whole declaration.
-
wanshu
ok, thanks for that clarification. I guessed it was something like that but I was not completely certain. :)