Quote:
Originally Posted by tuxdev
Streams are designed to tokenize input. Either make sure the input read in is whitespace separated or separated by some other special char, or just use the C function and forget about streams.
|
You can also use a combination of formatted (tokenized) input and unformated input:
char date[4]; // 4 for terminating nul that get() adds.
int year;
cin.get(date, 3) >> year;
Mike