Chaining Variable Assignment

 

I've read the variable assignment documentation and it doesn't mention anything about assignment chaining.


Is it possible to write:

double a = 1;
double b = 2;

like the following?

double a, b = 1, 2;
 
nightvision04:

I've read the variable assignment documentation and it doesn't mention anything about assignment chaining.


Is it possible to write:

like the following?

double a=1,b=2;
not possible i believe
 

This would work:

int a,b,c;
a=b=c=0;
 
Sardion Maranatha:
not possible i believe
double a=1,b=2;

This worked. Thanks!

Reason: