I have a C++ snippet that removes the first word of a line in a text file e.g.
test C:\Windows\System32
download C:\Program Files\test.exe
Although it removes the first word, there is a space left over after trimming it, is there a way to stop remove this space?
#include <iostream>
using namespace std;
int main()
{
string tmp;
while ( !cin.eof() )
{
cin >> tmp;
getline(cin, tmp);
cout << tmp << endl;
}
}