Re: Those of us who are C'ly challenged :>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jeffrey wondered about learning C.

Yes, C *is* icky. But it's not that hard to read. Like any other language,
it's best to learn the language in the natural idiom rather than work with
crutches of seeing it as if it were a different language (C to Euphoria
translator, for example).

I'm just re-learning C for a Euphoria-related project. It's actually a
pretty simple language - it's the pointers that add the complexity, as well
as give you the cool features. I'm using "The C Programming Language", by
Kernighan and Ritchie (the "K&R" book). In my mind, it's still the best text
out there. You probably want to supplement the difficult topic (pointers,
natch) with readings from other places. There are a number of good tutorials
available on the web.

Ironically, Euphoria did a pretty good jub of training me to get into the C
"frame of mind". Back when I used BASIC, I balked at having to use printf()
and their like. Now, they are second nature. Just be sure to look up the
parameters and return values of all the C functions - unlike Euphoria's
sprintf, for example, 'C's does *not* return a pointer to a string. There
were a number of gotchas like that.

I spent a couple days with the training wheels on, playing with a C
interpreter called Quincy (QNC) available at the Dr. Dobb's site. I'd
recommend it - except for lacking color coding, it's a very good training
platform. I eventually move on the the gcc and spent a week or so gnashing
my teeth over errors like:

    "The error occurs somewhere before the ;"

Probably the most unhelpful error message I can think of. Getting to know a
language is, unfortunately, also the process of learning to decode error
messages like the one above (which usually mean there is a missing
parenthesis, or something similar).

If you want a good project, try writing a tool for virtual string arrays.
You'll use most of the useful features in C, get a good handle on pointers,
and when you're done you'll have a very useful tool.

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu