C++ Primer - Chapter 1 (Getting Started) Flashcards
A function definition consists of what four parts?
A return argument, a function name (identifier), a parameter list (which may be empty), and a function body.
What is an “argument”?
A value passed to a function.
What does “assignment” do?
Obliterates an object’s current value and replaces that value by a new one.
What is a “block” of code?
Sequence of zero or more statements enclosed in curly braces.
What is a “buffer”? Give an example of where a buffer is used.
A region of storage used to hold data. IO facilities often store input (or output) in a buffer and read or write the buffer independently from actions in the program.
What is “cerr”?
An ostream object tied to the standard error, which often writes to the same device as the standard output.
What is a “character string literal”?
A sequence of characters enclosed by double quotation marks.
What is “cin”?
An istream object used to read from the standard input.
What is “clog”?
An ostream object tied to the standard error.
What is the edit-compile-debug process?
The process of getting a program to execute properly.
What is an end-of-file?
System-specific marker that indicates that there is no more input in a file.
What is an “expression”?
The smallest unit of computation. An expression consists of one or more operands and usually one or more operators. Expressions are evaluated to produce a result.
What is a header?
Mechanism whereby the definitions of a class or other names are made available to multiple programs.
What does it mean to “initialise”?
Give an object a value at the same time that it is created.
What is a stream manipulator?
An object, such as std::endl, that when read or written “manipulates” the stream itself.
What is a method?
A synonym for member function.
What is a namespace?
Mechanism for putting names defined by a library into a single place.
What is a parameter list?
Part of the definition of a function; a (possibly empty) list that specifies what arguments can be used to call the function.
What is a source file?
A file that contains a C++ program.