While playing around I found a result I cannot get my head around, which involves char arrays and pointer.
char charArray[] = "Array";
char* charPtr1 = "Array";
char* charPtr2 = "Array";
why is charArray != charPtr1/2
, but charPtr 1 == charPtr2
?
I though when creating charPtr1
, it would create a temp array and point to there. If that's the case, why aren't they the same?