C Array Questions and Answers
Practice ModeShowing 10 of 108 questions
Q71
What value does testarray [2][1][0] in the sample code below contains
int testarry [3] [2] [2] ={1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
Answer: Option D
Q72
What string does ptr point to in the sample code below ?
char *ptr;
char mystring [ ] ="abcdefg";
ptr=mystring;
ptr+=5;
Answer: Option A
Q73
Array name +1 is
Answer: Option B
Q74
char ** array[12][12][12]
Consider array, defined above. Which one of the following definitions and initializations of p is valid ?
Answer: Option A
Q75
Let the base address of the character array arr[50][50][50] is 2000, what will be the address of arr[20][25][30] if the array is represented in row-major format.
Answer: Option A
Q76
Int a[8] = [0, 1, 2, 3];
The definition of a above explicitly initializes its first four elements. Whch one of the following describes how the compiler treats the remaining four elements ?
Answer: Option B
Q77
Which of the following is the correct way to increment the variable "ptr"?
void *ptr;
struct mystruct myArray[10];
ptr = myArray;
Answer: Option B
Q78
Which one is the difference between an array and list ?
Answer: Option D
Q79
Which of the following format for a[3]+1
Answer: Option A
Q80
What is wrong with the mentioned below code (assuming the call to malloc() does not fall)?
char ptr1 [ ]="hellow World";
char *ptr2=malloc (5);
ptr2=ptr1;
Answer: Option B