Q. Write a program to identify the endianness of the machine you are working on. Can anyone please tell me how to do it !!!
Here is the code. Code: bool is_bigendian() { int i = 1; char *ptr = (char*)&i; // Assign into 1 byte pointer return (*ptr == 0); // Check if the 1 Byte is not having the value 1 which is assigned }