You are absolutely correct.But you got to bear in mind that when you use those as rvalues
they are different.One has the type char
, and can be used as an int
as it is implicitly converted to the ASCII value, while the other has type char*
.
Let me illustrate my point with a code if that helps:
int num='A'; //Valid, assigns 65 to num
char test=65; //Valid, as test will be 'A' after this
char *ptr="A" //Valid, assigns address of string "A" to pointer ptr
printf("%c,%d",'A','A'); // Output will be A,65
printf("%p",(void*)"A"); //Will print address where string "A" is
printf("%c","A"); ///WRONG
printf("%s","A"); //Works
Edit For the finer nuances, if you feel your understanding is up to that mark yet,refer to Mat's comment.Else read it after a few weeks when you have advanced further in your study of C.