C++: Object-Oriented

C++: Object-Oriented

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

What is the client program?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 14, 2020

Cards (20)

Section 1

(20 cards)

What is the client program?

Front

The .cpp file that contains the main function that utilizes the implementation and specification files.

Back

How are functions made to return objects?

Front

ClassName function { ClassName object; ...... return object; }

Back

What is the default access specifier?

Front

Private

Back

How are objects passed to functions? What's the prototype? Are they pass by value or reference?

Front

Objects are pass by value but you SHOULD usually pass them by reference. Prototype: void function (ClassName &x); Call: function(object);

Back

How many access specifiers does c++ have?

Front

3 private, public, protected

Back

How are variable and functions accessed via objects?

Front

objectVar.variable; objectVar.function(); EX: triangle.height; triangle.getArea();

Back

What 3 preprocessor directives should be in your class specification file?

Front

#ifndef class_h //include guard #define class_h //define class #endif //end class Essentially, this protects against including the same header file multiple times.

Back

What is true of destructor parameters?

Front

They never have any. The parenthesis are always empty.

Back

How is a class created in c++

Front

class className { public: ..... private: ..... };

Back

Default Constructor? How is it used?

Front

A constructor that has no parameters. No parenthesis are used when one is used. EX: Shape square;

Back

What is an inline member function?

Front

A function definition inside the class definition. Useful for simple functions such as accessors

Back

How is a constructor created? How is the definition created separately?

Front

className(); className:: className() { }

Back

Class Implementation File?

Front

A .cpp file where the function definitions are all defined.

Back

How are objects created?

Front

className objectVar; Ex: Shape triangle;

Back

How is a destructor created? How is the definition created?

Front

~className(); ~className:: className() { }

Back

What is the level of accessibility for public and private?

Front

Public: all variables/functions are available outside the class Private: variables/functions available only inside the class

Back

How is a function definition created separately for a member function of a class?

Front

returnType ClassName :: functionName() { }

Back

Class Specification File?

Front

a .h file where the class and its member variables and functions are defined.

Back

What 3 files are usually used in conjunction together when doing Object Oriented Programming in c++?

Front

Class specification file Class implementation file Client program

Back

Inside the client program and implementation file you must use what preprocessor directive to link your class?

Front

#include "class.h"

Back