What is the difference?
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" ?
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
Does the compiler put a '\0'
at the end of "q"
automatically when I use it as an argument to string functions?
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
Topic archived. No new replies allowed.