A
Aaron
I have some existing code that accepts a filename, opens that file, and
then processes it line-by-line. What I want to do is modify this
routine so that instead I can simply pass a huge char* string and it
will parse that just as it currently does the file contents. I am
still wrapping my head around streams and was wondering if there was a
simple way to modify the below code to accomodate this change. Your
time, and any assistance you could provide, is greatly appreciated. I
just don't know where to go to find this kind of information.
Aaron.
--BEGIN CODE--
ifstream designFile(dF);
if(designFile.fail() )
{
cout << "could not open " << dF << endl;
return(false);
}
char c;
do{
designFile >> c;
if( designFile.eof() )
break;
//do stuff
}
--END CODE--
then processes it line-by-line. What I want to do is modify this
routine so that instead I can simply pass a huge char* string and it
will parse that just as it currently does the file contents. I am
still wrapping my head around streams and was wondering if there was a
simple way to modify the below code to accomodate this change. Your
time, and any assistance you could provide, is greatly appreciated. I
just don't know where to go to find this kind of information.
Aaron.
--BEGIN CODE--
ifstream designFile(dF);
if(designFile.fail() )
{
cout << "could not open " << dF << endl;
return(false);
}
char c;
do{
designFile >> c;
if( designFile.eof() )
break;
//do stuff
}
--END CODE--