char warning

Started by
4 comments, last by Daaark 18 years, 11 months ago
hey i did this:

char Choice2;

but i get this warning: warning C4101: 'Choice2' : unreferenced local variable what's wrong?
Advertisement
You defined the variable, but never actually used it. If you are going to make use of it later, ignore the warning, otherwise, just get rid of it. Nothing to worry about.

Also, it helps to post more code. [lol]
Not much. The compiler warns you that you declared a variable (i.e. claimed a portion of memory for it) but did not use it. If you have a more complicated program this is very useful to see what can be removed or if you are doing something you did not expect. As soon as you do something with the declared variable, the warning disappears.

Greetz,

Illco

[EDIT: I already considered directly adding a 'beat me to it' to my message the first time around.]
The compilers telling you that you've defined a variable and not used it. So its taking up memory for your program but never used.
thnx i was puting it in a void function but it workes now
Quote:Original post by jordi_0071
thnx i was puting it in a void function but it workes now



???

Were you getting other errors as well? I've looked at some of your posts, and you never give enough information about what's going on for people to properly help you.

This topic is closed to new replies.

Advertisement