Which of the following statements about two-dimensional arrays is false? a. The
ID: 3854780 • Letter: W
Question
Which of the following statements about two-dimensional arrays is false? a. The array declaration provides the name of the array, its type, and its size. b. The size of the first dimension is optional. c. By convention the first dimension specifies the number of rows. d. Accessing individual values requires two indexes. e. Two-dimensional arrays must be uninitialized or fully initialized. A variable's address is the last byte occupied by the variable. While the address of a variable is fixed, the address stored in a pointer variable can be changed. More than one pointer variable can be pointing to a given variable at the same time. The indirection operator (*) and the address operator (&) provide two different ways to access data, that is, they serve the same function Which of the following statements about pointer variables is false? a. To access a variable through a pointer, we use the indirection operator (*). b. The indirection and address operators are the inverse of each other. c. To declare and define a pointer variable, we suffix its type with an asterisk. d. To change a pointer variable so that it is pointing to nothing, we assign it the value NULL e. Only one pointer can be pointing to a variable at a time Which of the following declares a pointer variable to an integer? a. int& p: b. int% p: c. int* p: d. int* p: e. None of the aboveExplanation / Answer
Ans 27.
e. Two dimensional arrays must be uninitialized or fully initialized.
Ans 28.
False
A variable's address is the starting byte occupied by the varibale and not the last.
Ans 29:
True.
A single pointer variable can be used to point to any number of variables in a single program, provided that it points to only one variable at a time. Thus the address strored in a pointer vvariable can be changed to make it point to some other variable, as long as the type of the pointer and the variable it is pointing to matches.
Consider the following example:
int a = 100; // Let's say teh address of a is 1004
int* ptr = &a; // ptr here stores the address of a, which is 1004
int b = 200; // Say its address is 1024
ptr = &b; // now ptr stores the address of b, which is 1024
Ans 30:
True.
Yes, more than one pointers can point to the same variables at the same time.
Consider the following example:
int a = 100;
int* ptr1 = &a; // ptr1 pointing to a
int* ptr2 = &a; // ptr2 pointing to a
Ans 31:
False.
While the address operator is used to access the address of a variable or data, indirection operator is used to get the value referanced by a pointer or any address. Thus they both serve opposite funtions. In simple words, They both are inverse of each other.
Ans 32:
e. Only one pointer can be pointing to a variable at a time.
Multiple pointers can point to same variable at a given time. This can be proved by the same example as in Ans 30.
Ans 33:
d. int* p;
The indirection operator following a data type and followed by a name declares a pointer to that data type.
Hope this helps...
BEST WISHES!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.