Question: C++ objects are passed by address by default. True False 2 points QUESTION 6 Variables with static storage class are allocated and initialized once at
-
C++ objects are passed by address by default.
True
False
2 points
QUESTION 6
-
Variables with static storage class are allocated and initialized once at the beginning of the program and remain allocated until the program ends.
True
False
1 points
QUESTION 7
-
A C++ program named examProg that has been coded to accept command-line arguments is run at the Unix command line as follows:
z1234567@turing:~$ ./examProg data.txt 20 3
What will be the value of the parameter argc?
A. 3
B. 4
C. 2
D. 1
2 points
QUESTION 8
-
A C++ program named examProg that has been coded to accept command-line arguments is run at the Unix command line as follows:
z1234567@turing:~$ ./examProg data.txt 20 3
What will be the value of the parameter argv[2]?
A. The C string "data.txt"
B. The C string "20"
C. The integer value 20
D. The C string "./examProg"
2 points
QUESTION 9
-
After three passes through the outer loop of a sorting algorithm, an array changes from
43 16 48 37 81 54 71 29 to
16 29 37 48 81 54 71 43 What sorting algorithm is being used to sort the array?
A. Bubble sort
B. Selection sort
C. Insertion sort
2 points
QUESTION 10
-
Arrays in C++ are passed by __________ by default.
A. value
B. address
C. reference
2 points
QUESTION 11
-
Assume that we have the following C++ program:
#include
using namespace std; int num = 10; int sum(int, int); int main() { int x = 3, y = 5; cout << sum(x, y) + num << endl; return 0; } int sum(int a, int b) { return (a + b); } What is the storage class of the variable a?
A. static storage
B. automatic storage
C. dynamic storage
2 points
QUESTION 12
-
Assume that we have the following C++ program:
#include
using namespace std; int num = 10; int sum(int, int); int main() { int x = 3, y = 5; cout << sum(x, y) + num << endl; return 0; } int sum(int a, int b) { return (a + b); } What is the scope of the variable num?
A. block scope
B. class scope
C. file scope
D. function scope
2 points
QUESTION 13
-
Assume that we have the following C++ program:
#include
using namespace std; int num = 10; int sum(int, int); int main() { int x = 3, y = 5; cout << sum(x, y) + num << endl; return 0; } int sum(int a, int b) { return (a + b); } What is the linkage of the variable num?
A. external linkage
B. no linkage
C. internal linkage
2 points
QUESTION 14
-
Assume that we have the following C++ program:
#include
using namespace std; static int num = 10; int sum(int, int); int main() { int x = 3, y = 5; cout << sum(x, y) + num << endl; return 0; } int sum(int a, int b) { return (a + b); } What is the linkage of the variable num?
A. internal linkage
B. no linkage
C. external linkage
2 points
QUESTION 15
-
Assume that you have the following variable declarations:
char food[20] = "cheeseburger"; char lunch[20];
Which of the following code fragments will copy the C string in the array food into the array lunch?
A. strcpy(food, lunch);
B. strcpy(lunch, food);
C. food = lunch;
D. lunch = food;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
