mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Clarify character literals
This commit is contained in:
parent
f23d470961
commit
ae86e4ebab
@ -53,11 +53,11 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
// However, C++ varies in some of the following ways:
|
// However, C++ varies in some of the following ways:
|
||||||
|
|
||||||
// In C++, character literals are one byte.
|
// In C++, character literals are chars
|
||||||
sizeof('c') == 1
|
sizeof('c') == sizeof(char) == 1
|
||||||
|
|
||||||
// In C, character literals are the same size as ints.
|
// In C, character literals are ints
|
||||||
sizeof('c') == sizeof(10)
|
sizeof('c') == sizeof(int)
|
||||||
|
|
||||||
|
|
||||||
// C++ has strict prototyping
|
// C++ has strict prototyping
|
||||||
|
Loading…
Reference in New Issue
Block a user