variable declaration
what does it mean when a program says int choice, i;?
Thanks.
[edited by - viper35al on February 9, 2003 6:22:53 PM]
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;
int choice;
int i;
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.
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.
int choice, i;
is a declaration of two integers, choice and i. It''s a short-cut of saying:
int choice;
int i;
is a declaration of two integers, choice and i. It''s a short-cut of saying:
int choice;
int i;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement