what is the difference between char *a & char a[]?
Printable View
what is the difference between char *a & char a[]?
char *a is a character type pointer variable while char a[] is a single dimensional dynamic character array
If what you meant is
[I]what is the difference between char *a="abcd" & char a[]=-"abcd" ?[/I]
What Sahil Jain said applies here also. From usage point of view, the a in a[] is actually a constant pointer and any operations like a++ will generate a compilation error. a++ is perfectly legal for the first case.