how can I input a console-entered string into multiple structure variables? I have the following structure:
struct MyTime {int hours, minutes, seconds;};
and need to prompt a user to enter a time in format hours:minutes:seconds and then store that time into the structure directly i.e. I can't input a string and then parse the string into hours, minutes, seconds. So I need a method that reads 1-2 numbers from the stream into MyTime.hours until a ':' is found, and then repeats for MyTime.minutes and so on. Also, I'd prefer a way that does not involve declaring extra variables. Any ideas?