675 views
1 votes
1 votes

Please can somebody explain how the answer is 3 not 6??

1 Answer

Best answer
2 votes
2 votes
You should not use an integer pointer to point to a character or anything other than int) or else the behaviour is undefined in C.
selected by

Related questions

4 votes
4 votes
1 answer
1
0 votes
0 votes
2 answers
2
vishalmessi asked Dec 11, 2016
4,106 views
#include <stdio.h int main() { int a[][3] = {1, 2, 3, 4, 5, 6}; int (*ptr)[3] = a; printf("%d %d ", (*ptr) , (*ptr) ); ++ptr; printf("%d %d\n", (*ptr) , (*ptr) ); return ...