/* * Note to CS70 students: the following two lines, plus the #endif * line at the end of the file, may be "magic" from your point of * view. They are necessary to get this assignment to work, and you * should always use similar code in any header file you write. We * will be covering their purpose later in class. */ #ifndef READSTRING_HH #define READSTRING_HH /* * Name: Geoff Kuenning * Course: CS 70, Spring 2000 * Assignment #4 * * This file contains the interface for the readString function. * Since it's a function and not a class, the interface is trivial: * just a single function prototype. * * Each time readString is called, it skips whitespace on the given * stream, and then returns the next contiguous string of non-white * characters. Whiteness is determined by the isspace() function * defined in ctype.h. Null characters are silently discarded. * * The string read is dynamically allocated (using "new[]") and sized * appropriately to match the input; there is no limit on the size of * strings read. It is the caller's responsibility to delete[] the * strings after they are no longer needed. * * If EOF is encountered on the input stream before any valid string * is found, the routine returns NULL. */ class istream; extern char* readString(istream& stream); // Read and return a non-white string #endif // READSTRING_HH