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

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -