I have just made different StringToInt() function pl. debug it.
Code:https://ide.codingblocks.com/s/264827
What is Mistake in my Code
if you want to take input as a string at once
then use getline because cin>>str takes only first no
cin>>t;
cin.get();
while(t--)
{
string str;
getline(cin,str);
i hope this helps
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course
in this case they work similarly
cin.get() will also return you character as well