-
Stupid Question Probably
i got a question lets say this program for example.
Code:
#include <stdio.h>
int main(void){
signed int foo = 1;
printf("foo is %i", foo);
return 0;
}
isn't it that same as
Code:
#include <stdio.h>
int main(void){
int foo = 1;
printf("foo is %i", foo);
return 0;
}
cause int is signed and the only way it would be different is unsigned so wouldn't it be better to just use int foo = 1; instead of signed int foo = 1;?
-
Yes, int's are always signed unless you say unsigned.
The same is not true for chars, which may be signed or unsigned (by default)
-
yeah i know that char care different so its really useless to use signed int foo; cause its signed by default right?