in Programming in C
342 views
0 votes
0 votes

main()

{

char *c , ch[10];

int *i , j[10];

float *f , g[10];

int x;

c = ch;

i = j;

f = g;

for ( x=0 ; x<=10 ; x++ )

printf("%p %p %p\n" , c+x , i+x , f+x);

}

in Programming in C
342 views

1 Answer

1 vote
1 vote

Here %p format specifier prints a pointer.It depend on how pointers are usually printed on your platform.

Now everything is simple .Suppose pointer is printing in hexadecimal .

0028FEF6    0028FECC 0028FEE4
0028FEF7    0028FED0 0028FEE8
0028FEF8    0028FED4 0028FEAC

.............           ..............      ..............

0028FF00    0028FEF4  0028FECC   

3 Comments

@manoj: it is not always true that int take 4 bytes float take 8 bytes.

0
0

@manoj: it is not always true that int take 4 bytes float take 8 bytes. rt?

0
0
this is architecture depends
0
0

Related questions