Wk. 9 Flashcards
What should header files contain and not contain?
Declarations. Should not contain code that will allocate space in memory
How do you invoke the linker?
Providing all of the .o files without the -c (compile only) switch
Does the order matter matter when linking .o files?
No, the order does not matter. The compiler will still create the a.out file
What is object oriented programming?
A combination of data and functions to manipulate that data into singular objects
What is the syntax for calling a function member?
[data type] [Tag Name]::[function identifier][parameter list] (the :: is the prefix)
What is the :: prefix called?
Scope resolution operator
If you want to make a const member function, where does the const go?
After the formal parameter list
Why is the main function not a member function?
It does not have a Tag Name or scope resolution operator.
What is the difference between a class and a struct?
The default accessibility of their members. Structs are public by default, classes are private by default
What does ADT stand for?
Abstraction Data Type
What is an ADT?
Complex data type that contains data alongside functions to manipulate that data. Uses encapsulation to hide implementation details.
What are class .cpp files called?
Implementation files
What is a constructor?
A special member function that is called when space is allocated for an object
What is the syntax for a constructor?
[tag name] : : [function name/same as tag name][parameter list]. There is no return type
Can a constructor have a non empty parameter list?
Yes, could use defaults arguments from function prototype