S
seema
Hi all,
I am new to C programming. I have doubt and I want to clarify here is
the program ,
#include <stdio.h>
struct windows
{
int i;
char me;
};
int main(){
struct windows xp;
printf ("%d ",sizeof(xp));
}
I am using Linux. On Linux above program prints 8. Basically sizeof
(int) is 4 and sizeof(char) is 1. Its supposed to print 5 right? Can
some body explain why it prints 8??
Thanks in advance,
Seema Rao
I am new to C programming. I have doubt and I want to clarify here is
the program ,
#include <stdio.h>
struct windows
{
int i;
char me;
};
int main(){
struct windows xp;
printf ("%d ",sizeof(xp));
}
I am using Linux. On Linux above program prints 8. Basically sizeof
(int) is 4 and sizeof(char) is 1. Its supposed to print 5 right? Can
some body explain why it prints 8??
Thanks in advance,
Seema Rao