GeeksforGeeks » C/C++ Programming Questions

What is the output?

(2 posts)

Tags:

  1. Ryan
    guest
    Posted 1 year ago #

    #include<stdio.h>
    int main(void)
    {
          char *p = NULL;
          {
               char c='A';
               p = &c;
          }
          putchar(*p);
          putchar(c);
    
          getchar();
          return 0;
    }
    
  2. s_iiit
    Member
    Posted 1 year ago #

    It will give an error ( c is undeclared), because scope of c is with in the blocks.we can't use c outside the block without declaration.


Reply

You must log in to post.

RSS feed for this topic