General Purpose: Delete all "white spaces" in text file, until the read-in char is _not_ a whitespace (mark as start of text file).
Problem: Cannot seem to shift char's over properly. (I think my problem is the inner loop - however other code may lead to this problem - I do not know)
#include <fstream>
int main()
{
std::ifstream file( "foo.txt" ) ;
char c ;
if( file >> c ) file.putback(c) ; // read and put back the first non-ws character
// copy everything from the first non-ws character onwards to foo.trimmed.txt
std::ofstream ( "foo.trimmed.txt" ) << file.rdbuf() ;
}