π Omitting Namespace
βοΈYou might see some C++ programs that runs without the standard namespace library.
βοΈThe using namespace std line can be omitted and replaced with the std keyword, followed by the :: operator for some objects:
@c_programming_tut
βοΈYou might see some C++ programs that runs without the standard namespace library.
βοΈThe using namespace std line can be omitted and replaced with the std keyword, followed by the :: operator for some objects:
@c_programming_tut
Structure of C++
πSyntax
Ways symbols may be combined to
create well-formed sentences.
πSemantics
meaning of syntactically valid statement.
@c_programming_tut
πSyntax
Ways symbols may be combined to
create well-formed sentences.
πSemantics
meaning of syntactically valid statement.
@c_programming_tut
Basic elements of C++
0β£ Reserved words
A reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label
@c_programming_tut
0β£ Reserved words
A reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label
@c_programming_tut
1β£ Identifier
is a name used to identify a variable, function, class, module, or any other user-defined item.
πStart with a letter or underscore
πConsist only of alpha-numeric symbols or the underscore symbol _
πNot be a reserved word
@c_programming_tut
is a name used to identify a variable, function, class, module, or any other user-defined item.
πStart with a letter or underscore
πConsist only of alpha-numeric symbols or the underscore symbol _
πNot be a reserved word
@c_programming_tut
2β£ Comments
a piece of descriptive text which explains some aspect of a program.
Comments can be used to explain C++ code, and to make it more readable. It can also be used to prevent execution when testing alternative code.
β Single-line comments //
β Multi-line comments /* */
@c_programming_tut
a piece of descriptive text which explains some aspect of a program.
Comments can be used to explain C++ code, and to make it more readable. It can also be used to prevent execution when testing alternative code.
β Single-line comments //
β Multi-line comments /* */
@c_programming_tut
Operators
Operators in C++, An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.
πOperators in C++ can be classified into 7 types
@c_programming_tut
Operators in C++, An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.
πOperators in C++ can be classified into 7 types
@c_programming_tut