Hi friends this is my first posting . i greet you all :) .
my query :
what should i write in the red portion so as to get the next memory location after
’a’ without using pointers . :confused:
Hope somebody solves my query .
That should suffice.
Hi Quzah ,
thanx for your reply , but how do i get the next --next-- next addresses if i put the printf command in a loop .
I fail to see what this proves you can do, if you can do it without pointers
It should be trivial. Think about it for a bit. How do you normally work your way through an array? How do you do it if you want to skip ahead by two or three or N each time? Apply that same logic to this problem.
Post your attempt, and we'll give you hints. Or, if you wait around long enough, someone will doubtless show up and do the whole thing for you. It never fails.
thanx Quzah for the encouragement , it really pegged me to go and get the ans .:
printf("\n%x",&a + i+sizeof( a ));
Or you could always do:
This way you don't have to add sizeof( a ) to what you have down as i in your version.
for( i = 0; i < foo; i++ )
printf("%x\n", &a + (i*sizeof(a)) );