I am new to C++ and I am trying to write a simple grocery shopping app, the input is in a format something like this:
Item Name
someid expiryDate manufacturerId cost
An example is:
Shampoo 8879 05 04 2015 1010 100.03
I want to format it in such a way that: 8879 05/04/2015 1000 $100.03 .....etc
How do I achieve this?
My attempt:
I tried using substring and then breaking the input down and then outputting in the required format but the issue i came across was that for example the price can be something like 45.00 then my approach would fail.
How can I achieve this?
Thank you