I want to take in multiple lines of input or rather input that is separated by spaces. I need to store the inputs in different values. Like if the input is a tax program: 2.3% space $2,300. I need to store 2.3 and 2,300 in different values. HOw can i do this?
Asked
Active
Viewed 36 times
0
-
why not take inputs by pressing enter ? – Nikhil Badyal Oct 29 '19 at 02:42
-
1float rate, price; cin >> rate >> price; – seccpur Oct 29 '19 at 02:58
-
it was a problem – Ro No Oct 29 '19 at 03:06
-
Use Option Two given in [this answer](https://stackoverflow.com/a/7868998/4581301) as inspiration. – user4581301 Oct 29 '19 at 03:07
-
@seccpur it printer 2.3 and 2 – Ro No Oct 29 '19 at 03:08
-
Keep things simple, enter price as 2300 and not as 2,300, to avoid parsing etc – seccpur Oct 29 '19 at 03:12