string substitution

Hello guys am in a little conundrum here. I have this program that i am working on. As you can see it opens up a file and displays the content of the file. Now i figured out how to remove the punctuation marks using string substitution but i cannot put it into useful code?

someone please help me?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  #include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cmath>
#include <vector>
using namespace std;

int main(){

    string word;
    ifstream concordance;
    
    //this line of code will open the text file called Code.txt
    concordance.open("C:\\Users\\P-PC\\Desktop\\Code.txt", ios::out);
        if(!concordance.is_open()){
           exit(EXIT_FAILURE);
        }
        string str  = word;
        if(str.substr(12,12)){
           break;
        }
          //string content;
          concordance >> word;

             while(concordance.good()) {
                  cout << word << "\n";
                  concordance >> word;
             }
system("pause");             
}
Topic archived. No new replies allowed.