Pointers Questions and Answers updated daily – C Language



12 Pointers Questions and answers section with explanation for various online exam preparation, various interviews, C Language Pointers online test. Pointers Questions with detailed description, explanation will help you to master the topic.

Pointers Questions

1.
   What will be the output of the program ?

#include

int main()
{
    char *str;
    str = "%s";
    printf(str, "Kn");
    return 0;
}



SHOW ANSWER
Correct Ans:k
Explanation:


2.
    What will be the output of the program ?

#include

int main()
{
    char str[20] = "Hello";
    char *const p=str;
    *p='M';
    printf("%sn", str);
    return 0;
}



SHOW ANSWER
Correct Ans:mello
Explanation:


3.
      What will be the output of the program ?

#include

int main()
{
    int i=3, *j, k;
    j = &i;
    printf("%dn", i**j*i+*j);
    return 0;
}



SHOW ANSWER
Correct Ans:30
Explanation:


4.
What will be the output of the program ?

#include<stdio.h>

int main()
{
    static char *s[] = {"black", "white", "pink", "violet"};
    char **ptr[] = {s+3, s+2, s+1, s}, ***p;
    p = ptr;
    ++p;
    printf("%s", **p+1);
    return 0;
}



SHOW ANSWER
Correct Ans:ink
Explanation:


5. The operator used to get value at address stored in a pointer variable is



SHOW ANSWER
Correct Ans:*
Explanation:


6.      A pointer is



SHOW ANSWER
Correct Ans:A variable that stores address of other variable
Explanation:


7. What would be the equivalent pointer expression for referring the array element a[i][j][k][l]



SHOW ANSWER
Correct Ans:*(*(*(*(a+i)+j)+k)+l)
Explanation:


8. If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?



SHOW ANSWER
Correct Ans:->
Explanation:


9. How many bytes are occupied by near, far and huge pointers (DOS)?



SHOW ANSWER
Correct Ans:near=2 far=4 huge=4
Explanation:
near=2, far=4 and huge=4 pointers exist only under DOS. Under windows and Linux every pointers is 4 bytes long.


10. In which header file is the NULL macro defined?



SHOW ANSWER
Correct Ans:stdio.h and stddef.h
Explanation:
The macro "NULL" is defined in locale.h, stddef.h, stdio.h, stdlib.h, string.h, time.h, and wchar.h.


11.
Can you combine the following two statements into one?

char *p;
p = (char*) malloc(100);



SHOW ANSWER
Correct Ans:char *p = (char*)malloc(100);
Explanation:


12.    What is (void*)0?



SHOW ANSWER
Correct Ans:Representation of NULL pointer
Explanation:


Are you seeking for good platform for practicing Pointers questions in online. This is the right place. The time you spent in Fresherslive will be the most beneficial one for you.

Online Test on Pointers @ Fresherslive

This page provides important questions on Pointers along with correct answers and clear explanation, which will be very useful for various Interviews, Competitive examinations and Entrance tests. Here, Most of the Pointers questions are framed with Latest concepts, so that you may get updated through these Pointers Online tests. Pointers Online Test questions are granted from basic level to complex level.

Why To Practice Pointers Test questions Online @ Fresherslive?

Pointers questions are delivered with accurate answer. For solving each and every question, very lucid explanations are provided with diagrams wherever necessary.

Practice in advance of similar questions on Pointers may improve your performance in the real Exams and Interview.

Time Management for answering the Pointers questions quickly is foremost important for success in Competitive Exams and Placement Interviews.

Through Fresherslive Pointers questions and answers, you can acquire all the essential idea to solve any difficult questions on Pointers in short time and also in short cut method.

Winners are those who can use the simplest method for solving a question. So that they have enough time for solving all the questions in examination, correctly without any tense. Fresherslive provides most simplest methods to answer any tough questions. Practise through Fresherslive test series to ensure success in all competitive exams, entrance exams and placement tests.

Why Fresherslive For Pointers Online Test Preparation?

Most of the job seekers finding it hard to clear Pointers test or get stuck on any particular question, our Pointers test sections will help you to success in Exams as well as Interviews. To acquire clear understanding of Pointers, exercise these advanced Pointers questions with answers.

You're Welcome to use the Fresherslive Online Test at any time you want. Start your beginning, of anything you want by using our sample Pointers Online Test and create yourself a successful one. Fresherslive provides you a new opportunity to improve yourself. Take it and make use of it to the fullest. GOODLUCK for Your Bright Future.


FreshersLive - No.1 Job site in India. Here you can find latest 2017 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.