char *pa; and char a[];

This tip submitted by avdtech on 2005-03-14 19:00:25. It has been viewed 48458 times.
Rating of 5.6 with 418 votes




although the two definitions look same, there is major difference:-

char a[] = "I am Here";
char *pa = "I am here";

u can't assign another string to array:
a = "You cannot" /* illegal */

otherwise with ap,
pa = "You can do this" /* legal */



More tips

Help your fellow programmers! Add a tip!