V
vze7jsc0
Has anyone computed the percentage of off topic posts in this group
using ANSI C?
usenet is a strange place
using ANSI C?
usenet is a strange place
Has anyone computed the percentage of off topic posts in this group
No.
using ANSI C?
Frederick said:Somebody posted:
ANSI C does not provide a facility for accessing Usenet, and thus one
cannot write a portable program for calculating such a percentage.
Frederick Gotham (in [email protected]) said:
| one cannot write a portable program for calculating such a
| percentage.
Eh?
#include <stdio.h>
#include <stdlib.h>
int main(int argc,char **argv)
{ long off_topic,posts;
if (argc < 3)
{ printf("Usage: %s <off_topic posts> <total_posts>\n",*argv);
exit(EXIT_FAILURE);
}
off_topic = atol(*++argv);
posts = atol(*++argv);
if (!posts && !off_topic) puts("No traffic.");
else if (!posts) puts("You're kidding, right?");
else printf("%G%% of %ld posts were off topic.\n",
(100.0*off_topic)/posts,posts);
return 0;
}
Somebody posted:
ANSI C does not provide a facility for accessing Usenet, and thus one
cannot write a portable program for calculating such a percentage.
Dave said:Standard C does not access _networks_, and particularly the Internet.
Usenet and more specifically netnews (which was originally only a
subset) predated the Internet, and although other transports have now
vanished AFAIK, it is defined and still operated so that each server
has a complete (modulo glitches) copy of all messages for however long
it chooses. And classically such servers kept these messages in simple
text files that not only can be read from C but easily so. Although I
haven't kept track of whether they still do, and I suspect not.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.