[quote user="460822"]The compiler complains ... data is undefined.[/quote]
I cannot reproduce that behavior. I do get this diagnostic ...
"file.c", line 3: warning: variable "data" was set but never used
But that is to be expected. The variable data is local to the function main. Once main goes out of scope, so does data. And within the scope of main, data is written, but it is never read.
Thanks and regards,
-George