I am writing a C++ Program The input string for the same includes a string which contains alphanumeric char, symbols, whitespaces. I need to take input till the end of line which signifies the end of input string
Tried using do while
like below, but while (value != '\n' || value != '\0');
is never getting satisfied, and even after pressing enter the while loop doesn't exit
do
{
cin >> value;
inputString.push(value);
} while (value != '\n' || value != '\0');
Example of Input String -
I am :IronnorI Ma, i
P.S. - I can't use getline
, string
library due to some coding constraints applicable in coding contests