choldax
16/03/2008, 21:05
char ch;
string st;
ifstream myfile("a.txt");
ofstream yourfile("b.txt");
for(int i=0; !myfile.eof(); i++)
{
myfile>>ch;
st[i] = ch;
cout<<ch;
}
for(int i=0; i<st.length(); i++)
{
if(st[i] == '-' && 'a'<=st[i-1]<='z')
{
st[i+1] = '\b';
}
}
cout<<st;
//yourfile<<st;
return 0;
}
program çalışırken patlıyor. hata nerede?
saygılar
string st;
ifstream myfile("a.txt");
ofstream yourfile("b.txt");
for(int i=0; !myfile.eof(); i++)
{
myfile>>ch;
st[i] = ch;
cout<<ch;
}
for(int i=0; i<st.length(); i++)
{
if(st[i] == '-' && 'a'<=st[i-1]<='z')
{
st[i+1] = '\b';
}
}
cout<<st;
//yourfile<<st;
return 0;
}
program çalışırken patlıyor. hata nerede?
saygılar