You are not logged in.

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

hasnain
Administrator
From: Chichawatni
Registered: 2014-10-13
Posts: 8,355
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


Failure is the first step towards seccess.

2015-09-12 06:06:38

Advertisement
Ads By Google

Re: C Language Pointer Determine Output:



\n

Board footer