Ques 6:-) What is difference between uninitialized pointer and - TopicsExpress



          

Ques 6:-) What is difference between uninitialized pointer and null pointer? Ans) An uninitialized pointer is a pointer which points unknown memory location while null pointer is pointer which points a null value or base address of segment. For example: int *p; //Uninitialized pointer int *q= (int *)0; //Null pointer #include int *r=NULL; //Null pointer What will be output of following c program? #include #include int main(){ char *p; //Uninitialized pointer char *q=NULL; //Null pointer; strcpy(p,"cquestionbank"); strcpy(q,"cquestionbank"); printf("%s %s",p,q); return 0; } Output: cquestionbank (null)
Posted on: Sun, 29 Sep 2013 05:18:49 +0000

Trending Topics



Recently Viewed Topics




© 2015