Explain how the following program can be used to determine w

Explain how the following program can be used to determine whether a computer is big-endian or little-endian:

Solution

A)

#include <stdio.h>

{
unsigned int x = 0x76543210;
char *c = (char*) &x;
   printf (\"*c is: 0x%x\ \", *c);
if (*c == 0x10)
{
printf (\"Underlying architecture is little endian. \ \");
}
else
{
printf (\"Underlying architecture is big endian. \ \");
}
   return 0;
}

 Explain how the following program can be used to determine whether a computer is big-endian or little-endian:SolutionA) #include <stdio.h> { unsigned int

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site