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

Recommended Answers

All 2 Replies

>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.

Thank you Narue!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.