What is the Output ?

Answer : NULL…

What is the Output ?

main () 
  char *p1="Name"; 
  char *p2; 
  p2=(char *)malloc(20); 

Answer : NULL

  • We are incrementing the pointers p1,p2.
  • When it reached the end of the string, *p2 points to NULL.
  • We have lost the address of the starting position.
Leave a Reply

Your email address will not be published.

You May Also Like