how could i edit a text file using f stream

i have a assignment which sayswrite a c++ program that converts each charecter afteer a period '.' to an uppercase charecter heres what i've done and its just reading the file whithout editing

#include<iostream>
#include<string>
#include<fstream>


using namespace std;
int main()
{string fileName="";
ifstream inFile;
cout<<"please enter the file name"<<endl;
cin>>fileName;
inFile.open(fileName);

string words;
string test;
while(!inFile.eof()){
getline( inFile, words, '\0');
inFile>>words;


for(int i=0;i<words.length();i++){




if(words[i]==(int)".")
words[i+1]-32;
}


}
inFile.close();
ofstream outFile;
outFile.open("habal.txt");
outFile<<words;

outFile.close();




}
thanks
Topic archived. No new replies allowed.