3rd Test Flashcards
(13 cards)
The name of an array is the address of the…
0th element of the array
When doing object oriented programming, include in the header space all this:
endif
#ifndef Header_H #def Header_H
How to make a class?
Class nameChosen {
};
What does each class have in it?
Public:
Private:
What to put in the private part of a class?
Things that the client won’t mess with.
What do you put in the public part of the class?
Functions (methods!! - only heir prototypes), things that the client will use.
When to use a .h file?
To create a class, and later it will be read into a .cpp file
What is the scope resolution operator?
(Data type) NameOfClass::nameOfFunction
What is a constructor?
It is a function with the same name as a class, it initializes all the characteristics of an object.
What is needed to include in a .cpp file for Object oriented programming?
include “something.h”
The specification file (where the class is defined) .h!
How many and what kind of files will I make to do object programming?
3
1) .h file: class declaration, with public & private.
2) .cpp file: where the functions are written out.
3) .cpp file: where the client can program and decide things!
What is the constructor?
NameOfClass();
It automatically gets called when an object is created by the user.
What is a destructor function?
A constructor that begins with ~.
Ex: ~constructorName.
It happens automatically when a variable leaves it’s scope.