Category : Files from Magazines
Archive   : CUJ9307.ZIP
Filename : 1107107B

 
Output of file : 1107107B contained in archive : CUJ9307.ZIP
// lwc.cpp: Display count of lines and words
#include
#include
#include

main()
{
const size_t BUFSIZ = 128;
char s[BUFSIZ];
size_t lc = 0, wc = 0;

while (cin.getline(s,BUFSIZ))
{
++lc;
istrstream line(s);
char word[BUFSIZ];
while (line >> word)
++wc;
}

cout << "Lines: " << lc << ", words: " << wc << endl;
return 0;
}

// Output from the statement "lwc < lwc.cpp"
// Lines: 24, words: 63



  3 Responses to “Category : Files from Magazines
Archive   : CUJ9307.ZIP
Filename : 1107107B

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/