closepop
closepop

Would you like to submit the test?


C Language :

Complicated Declarations




1.
Declare the following statement?
"An array of three pointers to chars".

char *ptr[3]();
char *ptr[3];
char (*ptr[3])();
char **ptr[3];




2.
What do the following declaration signify?

int *ptr[30];

ptr is a pointer to an array of 30 integer pointers.
ptr is a array of 30 pointers to integers.
ptr is a array of 30 integer pointers.
ptr is a array 30 pointers.




3.
Declare the following statement?
"A pointer to an array of three chars".

char *ptr[3]();
char (*ptr)*[3];
char (*ptr[3])();
char (*ptr)[3];




4.
What do the following declaration signify?

char *arr[10];

arr is a array of 10 character pointers.
arr is a array of function pointer.
arr is a array of characters.
arr is a pointer to array of characters.




5.
What do the following declaration signify?

int (*pf)();

pf is a pointer to function.
pf is a function pointer.
pf is a pointer to a function which return int
pf is a function of pointer variable.




6.
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)




7.
What do the following declaration signify?

int *f();

f is a pointer variable of function type.
f is a function returning pointer to an int
f is a function pointer.
f is a simple declaration of pointer variable.




8.
What do the following declaration signify?

void (*cmp)();

cmp is a pointer to an void function type.
cmp is a void type pointer function
cmp is a function that return a void pointer.
cmp is a pointer to a function which returns void .




9.
What do the following declaration signify?

char **argv;

argv is a pointer to pointer.
argv is a pointer to a char pointer.
argv is a function pointer.
argv is a member of function pointer.




10.
    What do the following declaration signify?

char *scr;

scr is a pointer to pointer variable.
scr is a function pointer.
scr is a pointer to char.
scr is a member of function pointer.




11.
What will be the output of the program?

#include<stdio.h>

int main()
{
    char far *near *ptr1;
    char far *far *ptr2;
    char far *huge *ptr3;
    printf("%d, %d, %dn", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
    return 0;
}

2,4,2
2,4,4
2,5,6
1,2,5




12.
What will be the output of the program in DOS (Compiler - Turbo C)?

#include<stdio.h>
double i;

int main()
{
    (int)(float)(char) i;
    printf("%d", sizeof((int)(float)(char)i));
    return 0;
}

1
2
4
6




13.
What will be the output of the program?

#include<stdio.h>

int main()
{
    char huge *near *far *ptr1;
    char near *far *huge *ptr2;
    char far *huge *near *ptr3;
    printf("%d, %d, %dn", sizeof(**ptr1), sizeof(ptr2), sizeof(*ptr3));
    return 0;
}

4,4,4
3,3,3
2,2,2
1,1,1




14.
     What will be the output of the program?

#include
typedef void v;
typedef int i;

int main()
{
    v fun(i, i);
    fun(2, 3);
    return 0;
}
v fun(i a, i b)
{
    i s=2;
    float i;
    printf("%d,", sizeof(i));
    printf(" %d", a*b*s);
}

2,8
2,4
4,8
4,12




15.
What will be the output of the program?

#include<stdio.h>

int main()
{
    char huge *near *far *ptr1;
    char near *far *huge *ptr2;
    char far *huge *near *ptr3;
    printf("%d, %d, %dn", sizeof(ptr1), sizeof(*ptr2), sizeof(**ptr3));
    return 0;
}

4,4,4
2,4,4
4,2,4
2,2,2










FreshersLive - No.1 Job site in India. Here you can find latest 2016 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.


FreshersLive - No.1 Job site in India. Here you can find latest 2016 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.