C and DS Gate Questions and Answers
C and Data Structures (DS) form the backbone of computer science, and mastering them is essential for anyone preparing for GATE, TCS, Wipro, or Infosys technical interviews. This collection of C and DS Gate technical questions with answers focuses on core programming concepts such as arrays, pointers, stacks, queues, and linked lists. Practicing these programming questions and answers enhances your ability to design efficient algorithms and optimize code performance. Each question includes detailed explanations and logic breakdowns to help you understand the underlying principles. These problems reflect the actual patterns seen in competitive exams and company placement tests, making this section an invaluable practice resource.
C and DS Gate
Showing 10 of
29 questions
1. Declare the following statement? "An array of seven pointers to chars".
- char *ptr[7]();
- char *ptr[7];
- char (*ptr[7])();
- char **ptr[7];
2. Declare the following statement? "A pointer to an array of seven chars".
- char *ptr[7]();
- char (*ptr)*[7];
- char (*ptr[7])();
- char (*ptr)[7];
3. What do the following declaration signify? char *arr[7];
- arr is a array of 7 character pointers.
- arr is a array of function pointer.
- arr is a array of characters.
- arr is a pointer to array of characters.
4. What do the following declaration signify? void *foo();
- foo is a pointer to an void type.
- foo is a void type pointer variable.
- foo is a function that return a void pointer
- foo function returns nothing
5. What do the following declaration signify? int *ptr[7];
- ptr is a pointer to an array of 7 integer pointers.
- ptr is a array of 7 pointers to integers.
- ptr is a array of 7 integer pointers.
- ptr is a array 7 pointers.
6. What do the following declaration signify? int (*foo)();
- foo is a pointer to function.
- foo is a function pointer.
- foo is a pointer to a function which return int
- foo is a function of pointer variable.
7. Declare the following statement? "A pointer to a function which receives an int pointer and returns float pointer".
- float *(ptr)*int;
- float *(*ptr)(int)
- float *(*ptr)(int*)
- float (*ptr)(int)
8. Declare the following statement? "A pointer to a function which receives nothing and returns nothing".
- void *(ptr)*int;
- void *(*ptr)()
- void *(*ptr)(*)
- void (*ptr)()
9. What do the following declaration signify? int *foo();
- foo is a pointer variable of function type.
- foo is a function returning pointer to an int.
- foo is a function pointer.
- foo is a simple declaration of pointer variable.
10. What do the following declaration signify? void (*foo)();
- . foo is a pointer to an void function type.
- foo is a void type pointer function.
- foo is a function that return a void pointer.
- foo is a pointer to a function which returns void .