Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

viper35al

variable declaration

This topic is 5672 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

Advertisement
It means that you are declaring two variables (''choice'' and ''i'') of type ''int''. It is a short-hand way of writing:

int choice;
int i;

Share this post


Link to post
Share on other sites
It is declaring two integer variables, with names choice and i.

Be careful with this syntax if you want to declare multiple pointers in one line i.e.

int * choice, i;

does not declare two pointers, but one called choice, the other an integer, i, however:

int * choice, * i;

does declare two integer pointers.

Share this post


Link to post
Share on other sites
int choice, i;
is a declaration of two integers, choice and i. It''s a short-cut of saying:
int choice;
int i;



Share this post


Link to post
Share on other sites
wow, I cannot believe that I forgot what that meant. I learned that a long time ago.

sorry for asking such a stupid question

thanks for the responses though.

Share this post


Link to post
Share on other sites

  • 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!