C++ Flashcards
Console Program
Use text to communicate with the user and to show their results
//
Line comment. All lines beginning with “//” are considered comments and do not have any effect on the behavior of the program. Used to include short explanations or observations within the source code itself.
#
Liens beginning with a # are directives for the preprocessor. They are indications for the compiler’s preprocessor.
int main ()
This line corresponds to the beginning of the definition of the main function. The main function is the point by where all C++ programs start their execution, independently of its location within the source code.
{ }
What the function does when it is executed.
cout «_space;” “
represents the standards output stream in C++, and the meaning of the entire statement is to insert a sequence of characters into the standard output stream
;
This character is used to mark the end of the statement and in fact it must be included at the end of all expression statements in all C++ programs
return 0
The return statement causes the main function to finish. return may be followed by a return code. A return code of 0 for the main function is generally interpreted as the program worked as expected without any errors during its execution.
/* */
Block Comment discards everything between the * characters and the first appearance the */ characters, with the possibility of including more than one line.
A valid identifier is…
A valid identifier is a sequence of one or more letters, digits or underscore characters (_). Neither spaces for punctuation marks or symbols can be part of an identifier.
Is C++ case sensitive?
yes
char
Character or small integer (1 byte)
short int (short)
Short Integer (2 bytes)
int
Integer (4 bytes)
long int (long)
Long integer (4 bytes)