[GNHLUG] Silly C/C++ question...
Ben Scott
dragonhawk at gmail.com
Mon Dec 1 17:20:21 EST 2008
On Mon, Dec 1, 2008 at 4:13 PM, <bruce.labitt at autoliv.com> wrote:
> Do you have a link to a K&R clone or a reference to the string command that would
> be useful? It looks like strtok would work, if I can figure it out...
Most of the C standard library has "manual pages" on most Linux
systems. So "man 3 string" should give you an index, and "man 3
strtok" will give you the info for that function. Not all the man
pages are helpful for this kind of thing, but some are.
(The "3" is the section number -- library functions are in section
3. Some user commands (in section 1) have the same name as library
functions, and would be displayed in preference to the library
function. Use "man -a foo" if you don't know what section "foo" is
in.)
I know there are "better" tools outside the C Standard Library for
text/string processing, but I don't know what they would be. It's
been close to a decade since I did any real C/C++ programming. Anyone
got some recommendations for Bruce? C++ Standard Template Library?
Something GNU?
> Jeesh, I'm liking python more and more...
"Rewrite the whole thing in $HIGHER_LEVEL_LANGUAGE you find easier"
might well be a realistic recommendation, depending on circumstances.
It's also possible to call C library functions from Python code. If
you've got an existing C codebase you must use, but have more luck
with Python, it might be effective to use Python as a front-end to the
C code.
I'm not trying to sell Python (I know very little of Python) or bury
C/C++ here. I'm just a big believer in using the tools that best fit
a given situation. If you, Bruce, find Python works better for you,
you should use it. :)
-- Ben
More information about the gnhlug-discuss
mailing list