char str[] = "a"; char ch = 'a';
speaking of the difference between the two, we all knowstr point to a memory space which stored [a, ], but I want to ask whether there is a difference between str[0] and ch?
str
str[0]
ch
but I want to ask whether there is a difference between str[0] and ch?
No.
str[0] and ch, both are of type char, and hold the value 'a'. From this aspect (type and value), there is no difference.
char
'a'
2.1m questions
2.1m answers
60 comments
57.0k users