mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Closes #1000
This commit is contained in:
parent
4562e82c01
commit
c88c28058b
@ -30,10 +30,10 @@ one of the most widely-used programming languages.
|
|||||||
|
|
||||||
// C++ is _almost_ a superset of C and shares its basic syntax for
|
// C++ is _almost_ a superset of C and shares its basic syntax for
|
||||||
// variable declarations, primitive types, and functions.
|
// variable declarations, primitive types, and functions.
|
||||||
// However, C++ varies in some of the following ways:
|
|
||||||
|
|
||||||
// A main() function in C++ should return an int,
|
// Just like in C, your program's entry point is a function called
|
||||||
// though void main() is accepted by most compilers (gcc, clang, etc.)
|
// main with an integer return type,
|
||||||
|
// though void main() is also accepted by most compilers (gcc, clang, etc.)
|
||||||
// This value serves as the program's exit status.
|
// This value serves as the program's exit status.
|
||||||
// See http://en.wikipedia.org/wiki/Exit_status for more information.
|
// See http://en.wikipedia.org/wiki/Exit_status for more information.
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
@ -51,6 +51,8 @@ int main(int argc, char** argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// However, C++ varies in some of the following ways:
|
||||||
|
|
||||||
// In C++, character literals are one byte.
|
// In C++, character literals are one byte.
|
||||||
sizeof('c') == 1
|
sizeof('c') == 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user