Hi
I heard in little endian, the LSB is at starting address and in Big endian MSB is at starting address. SO I wrote my code like this. If not why ?
void checkEndianess()
{
int i = 1;
char c = (char)i;
if(c)
cout<<"Little Endian"<<endl;
else
cout<<"Big Endian"<<endl;
}