hey there..
my lecturer gave me the source code and ask me to give comment for each line..
Code:
#include <stdio.h> //standard I/O header file to declare printf, scanf n other things
int main() //it tells it the return type and how many parameters there are, and what their
//types are
{
unsigned int i = 1; //why should i use unsigned? if use 'long', still get the same answer?
char *c = (char*)&i; //pointer? so.. c represent character point to i? (kinda blur here)
if (*c)
printf("Little endian");
else
printf("Big endian");
getchar();
return 0;
}
please guide me.. ^_^