Skip to content

Instantly share code, notes, and snippets.

@alexesDev
Created May 15, 2013 20:19
Show Gist options
  • Select an option

  • Save alexesDev/5587026 to your computer and use it in GitHub Desktop.

Select an option

Save alexesDev/5587026 to your computer and use it in GitHub Desktop.
#include <fstream>
#include <iostream>
#include <string>
int main()
{
std::ifstream in("input.txt", std::ios::in);
std::ofstream out("output.txt", std::ios::out);
if(in)
{
char tempChar;
while(!in.eof())
{
in.get(tempChar);
if(tempChar != ' ')
out << tempChar;
}
in.close();
out.close();
}
else
std::cerr << "Input file not found.";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment