hi fellas

guys iv got urgent question and asking for help:what i need to do write?
"code which takzes words from 1stfile and put those words into 2nd file written other way round.Words remain in the same position"

#include <cstdlib>
#include <iostream>
#include <fstream>
#include<cstring>

using namespace std;
int main ()
{
string wyraz;
const biale_znaki("\t",",",".");
ifstream plikwe;
ofstream plikwy;
plikwe.open("we.txt");
plikwy.open("wy.txt");

while(i!=plikwe.eof)
{
for (i=0,wyraz.length()-1,i++)
plikwy.append(wyraz,wyraz.end()-1,1)
}

return(0);
}


this is what i did but i wasnt born for programming please help me i need to finish that project by friday.Im gonna be so much grateful..

best regards
Simon
You need to do 3 things:
read words from file A
turn words around
write words to file B

Document your code a bit or use functions.

At first glance, you don't have a read operation on your ifstream, perhaps you can read the words to an array.

You don't have i declared

The expressions in your for() should be seperated by ; instead of ,

When you have your words in an array, loop the array word per word, turning around every word, perhaps using some string functions or just basic pointer manipulation.

write to file should be quite obvious.

Topic archived. No new replies allowed.