#include<iostream>
using namespace std;
int main(){
double a;
double b[10];
char *c;
char r[12]="appleeeeeee";
c=r;
cout<<sizeof c<<endl; //Why is this 8 and not equal to 12 i.e sizeof(r)
cout<<sizeof r;
}
q1. Isn't the array name a pointer to the beginning of the array?? If so then why does the sizeof operator evaluates to two different values in the above code.
i.e Why sizeof c yields 8 while sizeof r yields 12 even though both of them are pointer to a character.
Why is the size of the array r[12] printed in the second case?
this question may look like the duplicate of this but it doesnt answer my question.