Your using wrong type for ifstream and ofstream
try :
Code:
...
ifstream in(input.c_str());
ofstream out(output.c_str());
...
Also add return 0 at the end of the main() function
as you declared it as int main()
And may I suggest you to not test / make programs as root ?