Jump to content
  • Advertisement
Sign in to follow this  
jordi_0071

char warning

This topic is 4903 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey i did this:
char Choice2;

but i get this warning: warning C4101: 'Choice2' : unreferenced local variable what's wrong?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!