What are global variables in C++?

CS135-Review

Flashcard
•
Science
•
University
•
Hard
Quizizz Content
FREE Resource
Student preview

15 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
Global variables are variables that are declared outside of any function and can be accessed from any function within the same file.
2.
FLASHCARD QUESTION
Front
What is the impact of using global variables in C++ functions?
Back
They can lead to code that is difficult to understand and maintain due to potential side effects.
3.
FLASHCARD QUESTION
Front
What is the scope resolution operator (::) in C++?
Back
The scope resolution operator is used to define or access variables and functions in a specific scope, particularly to access global variables when a local variable of the same name exists.
4.
FLASHCARD QUESTION
Front
What happens when a function expects a reference parameter in C++?
Back
Any modification to the reference parameter within the function will affect the original variable passed to the function.
5.
FLASHCARD QUESTION
Front
What is the rule regarding default arguments in C++ functions?
Back
Parameters with default values must be the rightmost parameters.
6.
FLASHCARD QUESTION
Front
What happens when an array is passed to a function in C++?
Back
The function receives the address of the first element of the array.
7.
FLASHCARD QUESTION
Front
What is a reference parameter in C++?
Back
A reference parameter allows a function to modify the argument passed to it, as it refers to the original variable.
Create a free account and access millions of resources
Similar Resources on Quizizz
12 questions
Python Functions and Docstrings Flashcard

Flashcard
•
University
14 questions
CSP Unit 4 Review - Variables, Conditionals, Functions

Flashcard
•
KG - University
15 questions
Python Chapter 5: Functions

Flashcard
•
Professional Development
8 questions
Methods

Flashcard
•
University
15 questions
Section 1.1

Flashcard
•
University
15 questions
Parametric and Polar for BC

Flashcard
•
12th Grade
12 questions
1. The Tableau Workspace

Flashcard
•
Professional Development
11 questions
Computer Programming

Flashcard
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade