int num1, num2, num3, num4;
This is the only way I've figured out how to do this:
cin >> num1; cin >> num2; cin >> num3;
Is there a way to do something like this?
cin >> num1, num2, num3;
This would be helpful for me to complete assignments and save lines of code without looking sloppy.
>> returns a reference to the same istream, so you can chain them:
cin >> num1 >> num2 >> num3;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With