Help with some simple C++ questions

Hello, I'm currently reviewing for my first computer science exam and one of our study guides has some fill-in and true/false questions that I wanted to make sure I was answering correctly. Most of them I was able to put down what I believe is the answer, but a couple I had no idea. Could someone take a look and let me know how I did? Thank you very much.

A __________________ data type should be used to hold “whole” numbers?
int

Legal Identifiers/variable names can start with ____________________ or ______________________ .
underscore, letter

A __________ return type indicates that the function does not return a value.
void

A "Pass by Value" parameter passes a __________ of the value to a function and a "Pass by
Reference" parameter passes a_____________ of the value to a function.
? ? I do not know these ones

What operator returns the reminder of an integer math operation? ___________________________
Modulus / %

A return type of _________ indicates that a function does not return a value.
void

Having two functions with the same name, but different parameter lists is called ________
overload

The __________ and _______ loops will not iterate at all if their test expressions are false.
for and while

To access the value in memory pointed to by a pointer variable, you must use ___________ operator.
?
___________ is used to signify that a pointer doesn't point to anything.
?


Sample True/False Questions:

True/False: The instructions in a while loop are executed at least once.
False

True/False: An infinite loop can be caused by using a loop termination expression that is always true
True

True/False: You have to declare every variable in C++?
True

True/False: C++ is a case insensitive language.
False

True/False: A for loop always executes once.
False

True/False: It is illegal to use an assignment = as the input to a conditional (i.e. if):
True

True/False: You can change the value of a variable declared using the const keyword.
?
Last edited on
To access the value in memory pointed to by a pointer variable, you must use ___________ operator.
Answer: the * operator, this is called derefrencing - http://www.cplusplus.com/doc/tutorial/pointers/

___________ is used to signify that a pointer doesn't point to anything.
Answer: nullptr - http://en.cppreference.com/w/cpp/language/nullptr

True/False: You can change the value of a variable declared using the const keyword.
Answer: Why don't you find out yourself? - http://cpp.sh/5m6g
Last edited on
Topic archived. No new replies allowed.