string comparisons in C
sabbagh
sabbagh at acf3.NYU.EDU
Fri Jul 14 23:43:06 AEST 1989
In article <44672745.14a1f at gtephx.UUCP> covertr at gtephx.UUCP (Richard E. Covert) writes:
[...Misc comments about string matching in C...]
> But, I was browsing thru the MWC manual, and lo and behold I see
>pnmatch(). Now pnmatch is a wonderful little function which does string
>comparisons. And it even accepts wildcards, so I was in business. I just
>build an array of strings such as "*.PI1", and then by looping thru the
>array I can string compare a user inputted filename against the list of
>legal filetypes. Pretty neat solution.
>
> So, the moral of this little ditty, is READ YOUR MANUAL!!
>
>P.S. Does anyone know if pnmatch() is implemented on other C compilers??
I can't answer the question about pnmatch, however, in the May or June issue
of Dr. Dobb's Journal there is an article entitled "Adding Awk-like ext-
ensions to C". This gave a description and SOURCE CODE for C routines
that would perform AWK functions. For those non-Eunuchs (:-)) users out
there, AWK is a "little" language whose primary usage is string processing.
These extensions are very powerful and worth looking into.
Hadil G. Sabbagh
E-mail: sabbagh at csd27.nyu.edu
Voice: (212) 998-3285
Snail: Courant Institute of Math. Sci.
251 Mercer St.
New York,NY 10012
186,282 miles per second -- it's not just a good idea, it's the law!
More information about the Comp.lang.c
mailing list