0

What is the difference between "\n" and '\n'.?
Also what is the difference between " " and ' '??

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by doraemon
0

>What is the difference between "\n" and '\n'.?
>Also what is the difference between " " and ' '??
Nothing. :D

But seriously, the first is a string literal and the second is a character literal. The difference, aside from the data type, is that a string literal is an array of const char that always has a '\0' character at the end and a character literal isn't an array and doesn't have a null character.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.