LuckyLucks
asked on
multiple initialization in one line
Hi
I want to initialize a few variable to a particular value. I want to do this in one line for cleaner code.
For example:
int a,b,c=5;
I am using Visual studio. Only the last variable c seems to be initialized to 5.
Multiple initialization is not possible, or is it? And if so, how?
I want to initialize a few variable to a particular value. I want to do this in one line for cleaner code.
For example:
int a,b,c=5;
I am using Visual studio. Only the last variable c seems to be initialized to 5.
Multiple initialization is not possible, or is it? And if so, how?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
thanks, but you should turn the accepted solution and the assist (with points). HookooDooKu posted the solution. my comment was an add-on.
Sara
Sara
Try this from a command line:
set a=5 &set b=5 &set c=5 &echo a = %a% &echo b = %b% &echo c = %c%