1. ALL of it, in ONE variable
Code:
...
char document[32000];
char letter;
ifstream infile(...);
while(infile.getline(letter))
{
strcat(document,letter);
}
...
2. Only the first paragraph ( I don't know it's length )
Code:
...
char paragraph[1000];
ifstream infile(...);
infile.getline(paragraph,1000,'\n');
...
3. Only numbers
Code:
...
ifstream infile(...);
char letter;
char output[1000];
infile>>letter;
if(isdigit(letter))
strcat(output,letter);
...
4. Read everything but the spaces, in ONE variable
Code:
...
ifstream infile(...);
char word[20];
char everything[32000];
while(!infile.eof())
{
infile.getline(word,20,' ');
strcat(everything,word);
}
...
5. Fit each line in a different variable
look up linked lists... (too much code for now)
6. Have a variable which will contain only the numbers, but each number skips one character, which would give "135 539 13.7"
Code:
...
ifstream infile(...);
char letter;
char output[1000];
infile>>letter;
if(isdigit(letter))
{
strcat(output,letter);
infile.ignore(1);
}
...
note: these only work for the file you gave an example of... well the last one atleast... actually i'm not sure if they work at all because i didn't compile them...
edit: that last one won't get the decimal either...