how to read a txt file and store it into an array without numbers and punctuation?

I'm working on a program that can read a text file and analyze the percentage of each specific words. I've finished all of the functions, but have some trouble with removing numbers and punctuations. the text file looks like this: "1 guy is writing his shitty code, he got 6 functions ready but stuck at "reading into the array". he is so stupid."

here is my main:
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
	ifstream fin;
	string fileName;
	cout << "Please input the filename:" << endl;
	cin >> fileName;
	fin.open(fileName);
	string theWord;
	string buffWord;

	int pos = 0;
	string wordList[2000];

	while (!fin.eof()) {
		fin >> buffWord;
		int beginPos = 0;
		int length = buffWord.length();
		bool isLetter = true;
		int i = 0, j = 0;
		while (i < length) {
			if (isalpha(buffWord[i])) {
				buffWord[i] = buffWord[i];
			}
			else {
				buffWord.erase(i, 1);
			}
			theWord = buffWord;
		}
			wordList[pos] = theWord;
			pos++;
	}

	cout << wordList[14] << wordList[15] << wordList[16] << "lllll";  //this part is for testing 

the ideal value of array should be {"guy","is","writing",.....}
thanks a lot guys
Topic archived. No new replies allowed.