array1 = array2;
cout<< myValue [index] << endl; cout<< *(myValues + index) << endl;
A) int array[0];
B) float $payments[10];
C) void numbers[5];
D) int array[10];
E) None of these
int grades[ ]= {100,90,99,80};
shows an example of:
A) default arguments
B) an illegal array declaration
C) an illegal array initialization
D) implicit array sizing
E) None of these
A) you must finish an initialization list
B) you are not required to initialize the array elements
C) all array elements default to zero values
D) your array will contain no elements
E) will give an error
A) all dimensions
B) all but the first dimension
C) the size declarator of the first dimension
D) all elements values
E) None of these
A) number, one
B) number, zero
C) constant integer expression, zero
D) variable, -1
E) None of these.
A) the assignment operator with the array names
B) the quality operator with the array names
C) a loop to assign the elements of one array to the other array
D) Any of these
E) None of these
A) strings of the same length
B) strings of different lengths
C) uninitialized elements
D) All of these
E) None of these
A) illegal in C++
B) legal in C++
C) not recommended by the ANSI committee
D) not good programming practice
E) None of these
int numbers [] = {99,87,66,55,101};
for (int I =1 ; I<4; I++)
cout << numbers [I] << endl;
A) 99 87 66 55 101
B) 87 66 55 101
C) 87 66 55
D) 99 87 66
E) nothing. This code has an error
int number [4] = {99,87};
cost << numbers [3] << endl;
A) 87
B) 0
C) garbage
D) Null character
E) This code will not compile
A) vector v
B) int vector v;
C) int
D) vector
E) vector
vector
A) It creates a vector object and initializes all the first two elements with the values 10 and 2.
B) It creates a vector object with a starting size of 2 and the first element initialized with the value 10
C) It creates a vector object with a starting size of 10 and the first element initialized with the value 2
D) It creates a vector object with a starting size of 10 and all elements are initialized with the value 2
E) None of these
vector
A) It creates a vector object and initializes all of its elements to the value 10.
B) It creates a vector object with a starting size of 10
C) It creates a vector object and initializes the first element with the value 10.
D) It creates a vector object that can store only values of 10 or less.
E) E) None of these
A) insert_item
B) add_item
C) store
D) push_back
E) at
A) remove_item
B) delete_item
C) erase
D) pop_back
E) pop
A) complexity
B) efficiency
C) simplicity
D) speed
E) None of these
A) first
B) last
C) largest
D) middle
E) None of these
A) character, string
B) integer, double
C) binary, linear
D) linear, binary
E) None of these
A) bubble, linear
B) binary, linear
C) selection, bubble
D) ANSI, ASCII
E) None of these
A) from lowest to highest element
B) from highest to lowest element
C) beginning with the middle element
D) using a binary search
E) None of these
11, 8, 3, 20, 24, 5
A) 8, 3, 11, 20, 5, 24
B) 8, 11, 3, 5, 20, 24
C) 3, 5, 11, 20, 24, 8
D) 2, 5, 8, 11, 20, 24
E) 3, 8, 11, 5, 20, 24
A) never
B) seldom
C) indirectly
D) all of these
E) None of these
A) array names
B) Numeric constants
C) Function marks
D) all of these
E) None of these
A) all mathematical operations that are legal in C++
B) multiplication and division
C) addition and subtraction
D) B and C
E) None of these
sum += * (array++);
this statement ______
A)is illegal in C++
B) will always result in a compiler error
C) assigns the dereferenced pointer’s value, then increments the pointer’s address
D) increments the dereferenced pointer’s value by one, then assigns that value
E) None of these
A) still points to a valid object after the function ends
B) has not been assigned an address
C) was received as a parameter by the function
D) has not previously been returned by another function
E) None of these
cin >> *num3;
A) stores the keyboard input into the variable num3
B) stores the keyboard input into the pointer called num3
C) is illegal in C++
D) stores the keyboard input into the variable pointed to by num3
E) None of these
A) when a new variable is created by the compiler
B) when a new variable is created at runtime
C) when a pointer fails to dereference the right variable
D) when a pointer is assigned an incorrect address
E) None of these
int *ptr = new int;
A) results in a compiler error
B) assigns an integer less than 32767 to the variable named ptr
C) assigns an address to the variable named ptr
D) creates a are pointer named int
E) None of these
A) the address of the last byte storage
B) the average of the dresses used to store the value
C) the address of the fist byte of storage
D) general delivery
E) None of these
int number = 22;
int *var = &number;
cout << *var << endl; A) the address of the number variable B) 22 C) an asterisk followed by 22 D) an asterisk followed by the address of the number variable E) second statement throws an error
int *numbers = new int[5];
for (int I = 0; I<= 4; I++)
*(numbers+i) =I;
cout<< numbers [2] << endl;
A) Five memory addresses
B) 0
C) 3
D) 2
E) 1
int numbers [ ] = {0,1,2,3,4};
int *ptr = numbers;
ptr++;
After this code executes, which of the following statements is true?
A) ptr will hold the address of numbers[0]
B) ptr will hold the address of the 2nd byte within the element numbers[0]
C) ptr will hold the address of numbers [1]
D) 3rd statement will generate error
E) 2nd statement will generate error
#include
using namespace std
int main()
{
char arr[20];
int I;
for (I = 0 ; I < 10 ; I++)
*(arr + i) = 65 + I ;
*(arr + i) = ' ' ;
cout << arr;
return (0);
}
A) ABCDEFGHIJ
B) AAAAAAAA
C) JJJJJJJ
D) none of the mentioned
E) none of these