Pointers Questions and Answers
Pointers questions with answers are a crucial part of C programming preparation, often included in technical interviews and MCQ-based exams. Pointers are variables that store the memory address of other variables, making them fundamental to dynamic memory management and efficient program design. These C programming MCQ questions and answers help students understand pointer arithmetic, function pointers, arrays, and memory allocation. Commonly asked in placement exams by TCS, Infosys, and Wipro, mastering pointer concepts gives you a competitive edge in coding tests and programming interviews.
Pointers
Showing 10 of
217 questions
51. Array of pointers such as int*p[5]; is used for
- fixed row size and varying column size
- fixed row soze and fixed folumn size
- varying row size and fixed column size
- varying row size and varying column size
52. Pointer to array such as int (*a)[8]; is used for
- fixed row size and varying column size
- fixed row size and fixed column size
- varying row size and fixed column size
- varying row size and varying column size
53. given float x[5][5]; float (*y)[5]; the assignment of the array x to the pointer variable y may be done as
- y = &x;
- y = x;
- y [0] = x;
- *y=x;
54. Given float x[5][10], *y[5]; the assignment of the array x to y is done as
- y = x;
- y [0] = x; y[1] = x[1]; ... ; y[4] = = x[4];
- y[0] = x[0]; y[1] = x[1]; y[4] = x[4];
- both options b and c
55. Given char *p = "ANSI C"; identify the expression returning the value C.
- p[5]
- *"ANSI C" +5)
- "ANSI C"[5]
- All the above
56. Given char *t[10]; identify the correct statement.
- strcpy (t [0], "BASIC");
- t [0] = "JAVA";
- both options a and b
- none of the above
57. Given char (*t)[10]; t = (char*)malloc(50); identify the illegal statement.
- t [0] = "BASIC";
- strcpy (t [4], "FORTRAN");
- strcpy (t [0], "JAVA")
- both options b and c
58. Identify the arguments of main ( ).
- int argc
- char *argv [ ]
- both options a and b
- no agruments are allowed
59. Which is the correct function header for function main ( )?
- min (int argc, char *argv [ ] )
- main (int argc, char **argv)
- main (int argc, char *av [ ] )
- all the above
60. The first arguments argc in main ( ) counts
- The number of command line strings including the execution command
- The number of command line strings excluding theexecution command
- The number of lines in a program
- The number of characters in a program