Hello, I'm trying to get fstream to send words seperated by spaces (or tabs) into a two dimensional array (ie: one dimension for the word itself, one for distinguishing words). But... nothing I've tried seems to work. The problem is that I cannot find a way to make spaces/tabs in the input text cause an increment in the value of "j". Hell I can't get it to recognize spaces.
This is for an assignment with no strings allowed, only fstream and iostream. Any help would be appreciated.
#include <fstream>
#include <iostream>
usingnamespace std;
int main()
{
char chaine[300][25];
ifstream entree("dico.txt");
int i=0,j=0;
while (!entree.eof())
{
i++;
entree >> chaine[i][j];
//lacks a way of recognizing tabs/white spaces and trigerring j++ after one.
}
entree.close();
}
int main()
{
char chaine[300][25];
ifstream entree("dico.txt");
int i=0,j=0;
while (!entree.eof())
{
entree >> chaine[i];
i++;
//lacks a way of recognizing tabs/white spaces and trigerring j++ after one.
}
entree.close();
}