3rd Test Flashcards

(13 cards)

1
Q

The name of an array is the address of the…

A

0th element of the array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When doing object oriented programming, include in the header space all this:

A

endif

#ifndef Header_H
#def Header_H
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to make a class?

A

Class nameChosen {

};

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does each class have in it?

A

Public:

Private:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What to put in the private part of a class?

A

Things that the client won’t mess with.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What do you put in the public part of the class?

A

Functions (methods!! - only heir prototypes), things that the client will use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When to use a .h file?

A

To create a class, and later it will be read into a .cpp file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the scope resolution operator?

A

(Data type) NameOfClass::nameOfFunction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a constructor?

A

It is a function with the same name as a class, it initializes all the characteristics of an object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is needed to include in a .cpp file for Object oriented programming?

A

include “something.h”

The specification file (where the class is defined) .h!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How many and what kind of files will I make to do object programming?

A

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!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the constructor?

A

NameOfClass();

It automatically gets called when an object is created by the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a destructor function?

A

A constructor that begins with ~.
Ex: ~constructorName.

It happens automatically when a variable leaves it’s scope.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly