|
|
c m s c 311
f a l l 2 0 0 2 |
Some clarifications based on things brought up in class. Plus other stuff...
This is one of the latest versions of g++, and it now enforces namespaces. If you need to read about that in the CMSC 214 Tutorial located here.
Here's sample code for how to do this.
using namespace std ;
int main()
{
string line ;
while ( getline( cin, line ) )
{
// split line based on some delimiter, then print out
// each token on a separate line, surrounded by slashes.
// For example, if the line contained "cat, dog , elk ",
// print
// (1) /cat/
// (2) /dog/
// (3) /elk/
}
}
That will give you some indication if your tokenizer is working.
|
See the class syllabus for policies concerning email Last Modified: Wed Jun 5 10:38:37 EDT 2002 |
|
|
|
|
|