Sorry about the beginners question, but I've written this code:
#include <stdio.h>
int main()
{
int y = 's';
printf("%c\n", y);
return 0;
}
The compiler (Visual Studio 2012) does not warn me about possibility data-loss (like from int
to float
).
I didn't find an answer (or didn't search correctly) in Google.
I wonder if this because int
's storage in memory is 4 and it can hold 1 memory storage as char
.
I am not sure about this.
Thanks in advance.