first Flashcards
How does the c++ program run?
The operating system runs c++ program by calling main ()
What is the four elements of function definition?
Name, return type, formal parameter, and the body
What does it mean when we say built in types?
Defined by the language
Can you explain how return works?
it returns value to the function caller but you can also provide a value, but it must be the same as the return type, example if the return type is int the value returned must be int too.
What is a type?
defines the contents of a data element and the possible operations possible on those data.
Source file
file that contains source code
Explain why we need to provide suffix for the file? Give some examples of a C++ suffix
The suffix tells the system that the file is a C++ program. .cp .cpp
What is a library and why do we need it.
Collection of classes and functions
What is a stream?
Sequence of characters read from or written to an IO device
What does the term stream suggest?
It is intended to suggest that characters are generated and consumed sequentially overtime
What is iostream?
Header that provides the library types for stream-oriented
input and output.
Define iostream
iostream defines cin, cout, cerr, clog, which corresponds to standard input stream, standard output stream, unbuffered standard error stream, and buffered standard error stream.
Standard input and output
Input and output associated with the window in which the program executes
Standard error
Output stream used for error reporting
cin (see-in)
cout (see-out)
cerr
clog
istream object used to read from the standard input
ostream object used to write to standard output
ostream object used for error messages
ostream object used to report information about program execution to a log file
include pre-processor directive
tells the compiler to include a library or header
What is expression?
composed of one or more operands and an operator
Explain the output operator
Takes two operands, left-hand operand must be an ostream object and right-hand operand which is the actual value to be printed, output operator writes the value be printed to the left-hand operand. which will be the result of output operator.
Why is it possible to chain output request?
Result of first operator becomes the left-hand operand for the next operator.
String literal
Sequence of characters enclosed with a double quotation.