I have a txt file. Here is index:
1 A D C V K O F R W
2 Y I J M
3 Q P
4 E S Z N L
I got the letters in a variable called string readen[9];
readen[0]` = "A D C V K O F R W";
readen[1]` = "Y I J M";
Like this, there are blanks between them. I need to catch all the letters one by one like:
readen[0]` = "A";
readen[1]` = "W";
(Without blank)
Here is my code:
string read;
string readen[9];
char numbers[9];
ifstream file;
file.open("deneme.txt", ios::in);
for (int i = 0; !file.eof(); i++)
{
numbers[i] = file.get();
file.get();
getline(file,read);
readen[i] = read;
}
As I said, It's like this now --> readen[0]
= "A D C V K O F R W "
What's the best way to keep it like readen[0] = 'A' readen[1] = 'D'
?