Why special character '"' (quotes " ) can be declare that char c = '"' why not char c = '"'

Revision en1, by shuneo, 2023-02-10 17:01:51
char c = '"';
// it is compiled and successed.

I have a question that: why we can char c = '"'; instead of using char c = '\"'.

I used to think that char c = '"' is wrong before.

Thank you alot

Tags c/c++, syntax

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English shuneo 2023-02-10 17:04:08 22
en3 English shuneo 2023-02-10 17:03:46 2
en2 English shuneo 2023-02-10 17:03:14 5
en1 English shuneo 2023-02-10 17:01:51 320 Initial revision (published)