Home / C Programming / Pointers :: Yes / No Questions

C Programming :: Pointers

  1. Is there any difference between the following two statements?
    char *p=0;
    char *t=NULL;

  2. A.
    Yes
    B.
    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Is this a correct way for NULL pointer assignment?
    int i=0;
    char *q=(char*)i;

  4. A.
    Yes
    B.
    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Is the NULL pointer same as an uninitialised pointer?

  6. A.
    Yes
    B.
    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Will the program compile in Turbo C?

        #include stdio.h  
        int main()  
        {        
           int a=10, *j;    
           void *k;        
           j=k=&a;   
           j++;        
           k++;       
          printf("%u %u\n", j, k);  
          return 0;
       } 

     

  8. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Will the following program give any warning on compilation in TurboC (under DOS)?

    #include
      int main() 
      {    
          int *p1, i=25;    
          void *p2;    
          p1=&i;   
          p2=&i;     
          p1=p2;     
          p2=p1;     
          return 0;
     } 
    

     

  10. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum