Pointer MCQs

253 questionsC-ProgramPage 24 of 29

Practice free Pointer multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 253 questions — no login required.

Question 208easy
What does this declaration say?
int (*(*y)())[2];
Question 209easy
What will be the output of the following C code?
#include <stdio.h>
int x = 0;
void main()
{
    int *const ptr = &x
    printf("%p\n", ptr);
    ptr++;
    printf("%p\n ", ptr);
}
Question 210easy
Comment on the following declaration.
int (*ptr)(); // i)
char *ptr[]; // ii)
Advertisement
Question 211easy
How many number of pointer (*) does C have against a pointer variable declaration?
Question 212easy
Which type of variables can have the same name in a different function?
Question 213easy
Which is true for a, if a is defined as "int a[10][20];"?
Advertisement
Question 214easy
Which of the following expression is true for the following C statement?
ptr is array with 3 elements of pointer to function returning pointer of int
Question 215easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char a[2][6] = {"hello", "hi"};
    printf("%d", sizeof(a));
    return 0;
}
Question 216easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int a[4] = {1, 2, 3, 4};
    void *p = &a[1];
    void *ptr = &a[2];
    int n = 1;
    n = ptr - p;
    printf("%d\n", n);
}