#include <stdio.h>
#include <stdlib.h>
int main()
{
float *pf;
float m[][3]={
{0.1, 0.2, 0.3},
{0.4, 0.5, 0.6},
{0.7, 0.8, 0.9}
};
printf("%d \n",sizeof(m));
pf=m[1];
printf("%f %f %f \n",*pf, *(pf+1), *(pf+2));
printf("%f %f %f \n",*pf, *(pf++), *(pf++));
}
I do understand the output of 2nd last printf. Please correct me if I am wrong. pointer pf stores address of first element of m[1]. *pf goes to that first element and outputs 0.4, *(pf+1) increments and jumps to next elements address and outputs that element and so on. What I dont get is the last printf. Shouldn't it be the similar thing. Lets say in last printf *pf goes to address stored in pf(which is same as first element of m[1]), so output should be 0.4 but instead output is 0.6. For *(pf++) should increment to next element and output 2nd element, i.e. 0.5 and last one *(pf++) should also output 0.5 but instead outputs 0.4. Please explain I am really confused.