Friday, March 18, 2011

Findout Machine little endian or big endian

/*
* Endian.c
*
* Created on: Mar 9, 2011
* Author: Karthikeyan.D
*/

# include "stdio.h"
# include "conio.h"
int main()
{
int num = 1;
if(*(char *)&num == 1)
{
printf("\nLittle-Endian\n");
}
else
{
printf("Big-Endian\n");
}

return 0;
}

No comments:

Post a Comment