Pointer variable used without initialization C Visual -
void main(){ float = 5; float *test; *test = a; }
this doesn't compile. why? mean there instantly bug pointer variable cannot used without initializaiton.
here's link error http://i.imgur.com/tdiyotu.png
void main(){ float = 5; float *test; // pointer test contains random value // , because can not safe access memory *test = a; // not safe!. dereferencing random address give garbage. }
use test = &a
if want pointer have address of variable a.
Comments
Post a Comment