Thursday, February 3, 2011

Pointers



What is the output of the program? '
#include<stdio.h>
#include<conio.h>
void main()
{
int **i;
int *j=0;
i=&j;
clrscr();
if(NULL != i && NULL != *i)
printf("hello”);
getch();
}

4 comments:

  1. the condition part may cause any error...
    m not sure....

    ReplyDelete
  2. It might not print anything because the pointer variable j is not pointing to any variable...
    But i m not sure let me know if this is not the right ans.

    ReplyDelete
  3. Output: No Output
    Explanation: Initializing pointer with integer zero is equal to
    initializing pointer variable to NULL.

    ReplyDelete