Tuesday, June 06, 2006
For the first time since I learned C 18 years ago I noticed that the standard library function scanf (and friends) has been enhanced with many new formats and features.
E.g., the following code
scanf ("%s %[^\n]\n", name, args);
reads a "word" from the input (and assigns it to name) and then reads the rest of the line till end-of-line, irrespective of spaces and other symbols, and assigns it to args.
Very detailed description of scanf formats is available at Solaris 10 Reference Manual Collection pages.