Question Source: Aricent Interview
Although both expressions can be used to create a variable to store one character, there are following differences.
1) “char a” represents a character variable and “char a” represents a char array of size 1.
2) If we print value of char a, we get ASCII value of the character (if %d is used). And if we print value of char a, we get address of the only element in array.
65 An address
This article is contributed by Abhishek. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.