data member - Answers components of a class
encapsulation - Answers the process of putting primitive data types all together under one
object or class
Steps in creating an object in C++ - Answers - type
- name
- member data
- member functions
state of an object - Answers member data, what is already declared
Member functions - Answers the behavior of an object, what the object is able to do
DDU - Answers declare define use
interface - Answers makes it so that users do not have to understand implementation details
two most basic protection levels: - Answers public and private
scope resolution operator - Answers :: - links the behavioral function to the class
accessors - Answers functions that do not change state - const
mutators - Answers functions that do change the state
getters - Answers an accessor
int const Blob::getHealth() const {
return health;
}
setters - Answers mutators that set the value of a private variable:
void Blob::SetHealth(int a) {
a = health;
}
object construction - Answers the process of taking the template and creating a new object or
, instance
how many parameters does the default constructor take in? - Answers ZERO
how many parameters can a parameterized constructor take in? - Answers as many as you want
true or false, constructors are a function with the same name as the class - Answers true
<filename>.h - Answers HEADER file
<filename>.cpp - Answers IMPLEMENTATION file
driver.cpp - Answers "DRIVER" file
compilation - Answers the process of translating C++ code into binary that a machine can
understand
2 steps of compilation - Answers 1 - compile step - checks for syntax errors, translates C++
code into an intermediary representation called object mode
2 - linking step -the process of taking the code file(s) from the previous step and building an
executable program out of them
-source code
-object code
-executable - Answers -.h/-cpp
-.o
-.exe
#include - Answers used to link any implementation to a relevant interface
"-c" - Answers used in unix to perform only the compilation step and build the .o files
g++ -c <filename>
compilation error - Answers related to syntax, access issues, undeclared variables/functions,
etc.
linker errors - Answers usually related to undefined functions or functions with multiple
declarations
run-time errors - Answers a. fatal errors - causes the application to crash
non-fatal error - no crash; but incorrect results