C++ FUNdimentals Flashcards

1
Q

What is the “Entry Point” function for C++

A

the main() function

int main()
{
}

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

What is a function?

A

A function contains a series of instructions. When the function is run each of the instructions is carried out from first to last.

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

What is the function header?

A

Contains the name of the function

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

What is the Function body?

A

Contains all the function commands

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

How do you finish a code statment in C++

A

It has to end in ; or the computer won’t recognize it.

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

Programmers create libraries that are fille with completed functions. How to you add them to your program?

A

include <partyLibrary></partyLibrary>

Using the #include directive

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

How do you call a function?

A

by putting the name of the function ending with();

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

How do you input strings in the printf(); function?

A

Using “ “ around the text you want to have entered

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

How do you write a comment in C++?

A

/* comment */

You can do multiple lines by doing:
/*
*hello
*goodbye
*/

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

what are the two different kinds of files that #include uses?

A

<> and “”

The angle brackets are ones that have been created and are built into the language.

the quotes are external libraries and have to be downloaded.

They have the proper header file extension called .h

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

How do you initialize a window pop up using the raylib.h library?

A

using the function initWindow();

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

How do you initialize a window pop up using the raylib.h library?

A

using the function initWindow();

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

Some functions have multiple paramaters. (think excel. Separated by commas)

A

VERY IMPORTANT

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

What parameters does InitWindow require?

A

InitWindow(width, height, title);

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

What is an Integer?

A

A whole number

1, 75, -100

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

What does the Type of data do?

A

Determines how the data is stored

integer
double
float
etc.

16
Q

Variables have three parts, what are they?

A

Name
Value
Type

numberOfCookies
9
int

int numberOfCookies;
numberOfCookies = 9;

17
Q

How do you declare a variable?

A

by writing its data type and then the variable name

int numberOfCookies;

18
Q

How many decimals can a float hold?

A

6-7

19
Q

How many decimals can a double hold?

A

15-16

20
Q

What is the difference between a float and a double?

A

A float uses less decimals, which means less accuracy but also uses less memory.

21
Q

What is a boolean?

A

A true or false statement

22
Q

What is braced initialization?

A

Declaring a variable using the {}
double cheese_burger{1.99};

23
Q

What is the == comparison operator?

A

It compares the value on the left to the right
bool fourIsNine;

fourIsNine = (5==9);