stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
CS136 Quiz #2 Flashcards | StudBud
Explore
/
CS136 Quiz #2
CS136 Quiz #2
27 terms
·
StudBud Administration
·
70 plays
Test your knowledge on C++ programming concepts and syntax
Flashcards
27 cards
F
Practice quiz
P
Host live
L
Questions
27
Answers
1
What is the output?
0
Undefined Behavior
4
2
What statement about “int *p = false;” is true
Functions the same as int *p = NULL; but is bad style
Compile Error: type mismatch
3
Who is a CS136 professor?
Cameron Morland
Urs Hengarner
Stacy Watson
Nomair Naieem
4
What is the output?
3
1
Compile Error
5
What is the output
10, 20
Every output is undefined
10, undefined value
6
This is legal (True/False)
False
True
7
What is the output
Compile Error
3
2
4
8
What is the output
0, 2
2, 2
0, 1
2, 1
9
Suppose int array a is stored in address 0x5000. What is printed?
0x5000, 0x5001, 1, undefined value
0x5000, 0x5001, 1, 2
0x5000, 0x5004, 1, 2
1, 2, 1, 2
10
Who was it?
Bradley Low
Jaden Leung
Stacey Watson
Nathan Smith
11
What does the -o flag mean in clang?
Warn all warnings
Generate source level debug information
Generates implementation file (.o) instead of the executable
Names the executable file
12
Using a constant to set the length of an array is good style
False
True
13
You can set an int equal to a const int
True
False
14
Latest time an ISA/Instructor has answered a question
3 am
1 am
4 am
2 am
15
When is the midterm exam
Monday, March 10
Friday, March 7
Monday, March 3
Friday, Match 14
16
How many of these are magic numbers that should be replaced with constants?
1
2
0
3
17
Assignment 4 Question 2: The tracking window can have any integer > 0 width and height
True
False
18
Suppose a is an int array, length 5. What happens when you print a[5]?
Compile Error
Prints 0
Undefined Behavior
Prints 5th element of array
19
Linux: Difference between > and >> for redirection?
> redirects to std output, >> redirects to std error
> overwrites a file, >> appends to the file
> appends to the file, >> overwrites a file
20
Which of these are not equivalent to a[1], where a is an array of length 5?
(a+1)[0]
*&a[1]
*(a+1)
(&a)[1]
21
Uninitialized local arrays are zero-filled
False
True
22
Style issues?
Both line 11 & 12
Line 12
No issues
Line 11
23
What is the output?
5
Error: Stack-use-after-return
Error: Segmentation-fault-on-null-address
24
Uninitialized global arrays are zero-filled
True
False
25
Bash Scripting: How to get the first argument from command line?
-1
-0
$1
$0
26
You can make an int * point to a const int
True
False
27
Most popular game played among the ISAs
Bloons TD 6
League of Legends
Valorant
Clash of Clans