clanguage07@gmail.com

clanguage07@gmail.com

Sunday, September 8, 2013

Wild pointer in c programming language.

Wild pointer in c programming language.

Wild pointer:

A pointer in c which has not been initialized is known as wild pointer.

Example:

What will be output of following c program?


#include<stdio.h>
int main(){

int *ptr;

printf("%u\n",ptr);
printf("%d",*ptr);


return 0;
}


Output: 


Any address
Garbage value

Here ptr is wild pointer because it has not been initialized.

There is difference between the NULL pointer and wild pointer. Null pointer points the base address of segment while wild pointer doesn’t point any specific memory location.

No comments:

Post a Comment

GET MORE INFORMATION

http://ads.qadservice.com/t?id=c2168e05-8974-4816-872a-91936ff7379d&size=1024x768&drct=true