2019 Solutions T/F Flashcards
C++ was developed by Ken Thompson and Dennis Ritchie
F
The C standard library is included in the standard C++ library
T
C++11 was the first standard released by the ISO group for the C++ language
F
A C++ program can contain a compile well-written code.
T
C++ programs are first compiled to intermediate “o-code” files.
T
Hubert likes little boy wieners
T
Atomic types like int cant be initialized using () as objects are
F
o-code files need to be processed to executables before being sent to the OS for execution
T
Dividing a non-zero double type value by zero causes a run-time error
F
The var keyword uses type inference to type variables in C++
F
The GCC compiler is hte only c++ compiler that adheres to the ISO standards
F
The long double type uses extended precision in C++
T
It is not legal to have a pointer to an atomic type variable, like an int
F
C++ style casts are templated
T
The operator -> combines dereferencing and membership when used with a pointer
T
A reference cannot be assigned to a nullptr
T
The memory consumed by a reference depends on where you are using a 32-bit or a 64-bit compiler
F
By using pointer arithmetic it is possible to read memory locations that have not been assigned to variables
T
The operateor & acts to dereference a pointer
F
A struct can only contain members that are all of the same type
F
The STL string class is immutatable
F
A C++ array will not allow you to supply index values that are out of range of the array
F
A vector collection from the stl cannot use [] to access members
F
The operator | is the same as || except that it doesnto ues short circuit evalaution
F
Only one class can be implemented at a time in a *.cpp file
F
The string member .at() will throw an exception of an attempt is made to access a character beyond the size of the string
T
In a boolean expression a non zero integer will be consider as false
F
The assignment operator returns the value being assigned
T
The goto statement is legal syntax in C++
T
Constructors should always be declared as const
F
A pointer that has been assigned to nullptr will be evaluated as being true
F
The vector member function .at() can be used on the LHS of an assignment statement
T
A default constructor is invoked with a set of empty brackers ()
F
Ambiguities can result from using the “using” keyword for too many namespaces
T
Programs that have implementation code in the header or *.h file will not compile
F
If const is used at the ned of a member function declaration then that function cannot chang ethe values contained in the attributes of its own class.
T
The #pragma once pre compiler directive can be used to prevent the redeclaration of a header files contents
T
Passing by constant reference is usually the best way to pass an argument into a function
T
The initialization section in a constructors implementation can be used to carry out error checking on the arguments supplied to the constructor
F
It is bad practice to return a reference to a variable that is local to the function returning it
T
Only exceptions that extend std::Exception can be thrown
F
The *.cpp file containing the implementation of the declarations contained in a header, or *.h file must have an #include statement for that header file
T
If a single namespace is used with the “using” keyword then the scope resolution operator will not be needed t identify names from that namespace
T
Variables cannot be declared outside a function or class
F
Local variables cannot be declared as static
F
Default arguments must be assigned in a function prototype or declaration only
T
C++ does not allow the definition of lambda functions
F
Inline functions must be implemented in the header file
T