in reply to C vs. Perl
#include <stdio.h> #include <DIE.h> #include <ARRAY.h> #include <HASH.h> #include <SPLIT.h> #include <FILE.h> int main(int argc, char **argv) { FILE *f; char *buf; HASH *h = new HASH(); if ((f = fopen("data", "r")) == NULL) DIE("unable to open file"); while(buf = READFILE(f)) { ARRAY *ar = SPLIT(buf); h->AddElement(ar[0], ar[1]); free(ar); free(buf); } printf("price of apple is : %s\n", h->GetElement("apple")); fclose(f); return(0); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: C vs. Perl
by Anonymous Monk on Oct 23, 2003 at 02:26 UTC | |
by Roger (Parson) on Oct 23, 2003 at 12:13 UTC | |
|
Re2: C vs. Perl
by dragonchild (Archbishop) on Oct 23, 2003 at 17:22 UTC |