In C++ can you go from a larger type to a smaller type. Example
long lg;
int in;
lg = 89;
in = lg;
Is this legal or will the compiler give an error????
Printable View
In C++ can you go from a larger type to a smaller type. Example
long lg;
int in;
lg = 89;
in = lg;
Is this legal or will the compiler give an error????
no. and on Windows int is the same size as long. But you may get a warning when it is shorter.
The best things come to those who rate