i'm supposed to read strings from a data file that contain words seperated by numbers, i'm supposed to convert the numbers to spaces and reverse the list of stings when i print them to the screen, so they make a paragraph
(meaning the bottom string in the data file should be printed as the first, and so on)
here is the information in the data file:
i've gotten almost nowhere with my code, here's all i gotQuote:
the1text,2you3should4look5at6that7as8well.
Likewise,9if8there7are6numerals5mixed4throughout
321
order,1then2you3still4have5some6work7to8do.
of9pieces8of7sentences6with5the4parts4out3of
If,2on1the1other2hand,3this4seems5to6be7a8jumble
0
other.494
sentences1which2flow3logically4from5one6to7the
that8it9makes8sense7I6mean5that4it3contains
then2your1program1most2likely3works.44When5I6say
If,7when8you9read8this,7it6seems5to4make3sense
looking for urgent help as assignment is due very soonCode:#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
#include <ctype.h>
int main ()
{
char buffer[256];
ifstream input ("A:\input4.dat");
while (! input.eof() )
{
input.getline (buffer,100);
char getchar;
cin>>getchar;
if(isdigit(getchar))
cout<<" ";
cout << buffer << endl;
}
return 0;
}
thanx,
Isaiah