Lets say I have printed out a value to my console application using std::cout<<
and have not ended the line, then later on I wanted to add data to the same line and input it into my programme through getline(cin, MyInput)
, but I want to make use of the entire line rather than just the values in-putted through the keyboard.
consider the value printed out on the screen is 5 and then * 6 is entered through the keyboard, then my programme should multiply 5 * 6! (this is not the purpose of my programme im just trying to get the idea across)
I have tried using a variable that holds the value printed out onto the console application and then I reused this variable but this is not the ideal solution, what I am looking for is a method to consider everything printed on one line (whether its from cin or cout) as one!