Comp Sci II Midterm

14 flashcardsby Eucalyptus
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
Passing by reference using &,
Allows you to change the value of the argument
2
What is the syntax to overload operators such as --, ++, etc?
Object Object::operator--(int)
3
How do you access a static member of an object?
::
4
How do you access a non-static member of an object?
Period
5
What is a pointer?
A variable that holds the address of another variable
6
What is a struct?
A collection of variables. These variables can be of different types, unlike arrays.
7
Declare a struct
struct {
int num;
string str;
} structName;
8
How do you access a member of a structure?
structName.varName
9
What is the difference between a private and public member of a class?
Private members can only be accessed or viewed from inside the class, public members can be accessed outside the class
10
What is the difference between a struct and a class?
A struct has no methods
11
Mutator
Can change the value of one or more data members. Setter, or set, functions are mutators, but it is NOT the case that all mutators are set functions. In the Date class, all the set functions are mutators, but increment() is a mutator as well.
12
Facilitator
Provides a result based upon the value of one or more data members. Facilitators figure something out. In the Date class, leapYear() is one facilitator.
13
Inspector
Sometimes referred to as an accessor function, an inspector merely furnishes the value of one or more data members. Get (or getter) functions are inspectors. In the Date class, getDate() is not a classic get function, as it furnishes multiple data members’ values, but it is certainly an inspector.
14
What does the & operator provide when used?
The address to the variable it is used on
Study all 14 cards for free