You are not logged in.

#1 2015-09-12 06:06:36

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
Website

C Language Pointer Determine Output:

C Programming Quizzes C Language Pointer

Directions:
Determine output:

Question:
#include <stdio.h>
void main()
{
      char *p = NULL;
      char *q = 0;
      if(p)
            printf(" p ");
      else
            printf("nullp");
      if(q)
            printf("q");
      else
            printf(" nullq");
}

Option A):
nullp nullq
Option B):
Depends on the compiler
Option C):
x nullq where x can be p or nullp depending on the value of NULL
Option D):
p q

Correct Answer is Option A):
nullp nullq


You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-09-12 06:06:36

Advertisement
Ads By Google

Re: C Language Pointer Determine Output:



\n

Board footer