home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_07
/
1107103a
< prev
next >
Wrap
Text File
|
1993-05-04
|
302b
|
21 lines
// wc.cpp: Display word count
#include <iostream.h>
#include <stddef.h>
main()
{
const size_t BUFSIZ = 128;
char s[BUFSIZ];
size_t wc = 0;
while (cin >> s)
++wc;
cout << wc << '\n';
return 0;
}
// Output from the command "wc < wc.cpp"
// 35