Mar 5, 2011 at 1:09am
As I know "q" is a string constant(?) and 'q' is a single character.Why I can't use 'q' as argument to a function such as strcmp,while I can use "q" ?
Mar 5, 2011 at 1:17am
That would be because "q" is a string literal (type: char*) and 'q' is a single character (type: char). They're kind-of different types. :/
-Albatross
Mar 5, 2011 at 11:59am
Does the compiler put a '\0'
at the end of "q"
automatically when I use it as an argument to string functions?
Mar 5, 2011 at 12:10pm
oldnewbie wrote: |
---|
Does the compiler put a '\0' at the end of "q" automatically when I use it as an argument to string functions? |
Yes it does
Last edited on Mar 5, 2011 at 12:11pm