C++ Compiling Problems
Matthew Miller
mattdm at mattdm.org
Mon May 23 14:31:11 UTC 2005
On Mon, May 23, 2005 at 10:07:42PM +0800, John Summerfied wrote:
> >Brian Kernighan and Dennis Ritchie. As I said before, C is an elegant and
> >small language, and this book is all you need. (Although you may also want
> >to pick up The UNIX Programming Environment by Kernighan and Rob Pike.)
> K&R C is no longer current, and I think it will give gcc severe heartburn.
As mentioned before, the updated second edition is ANSI C. That's not C99,
but gcc will be completely happy.
> There are altogether too many mistakes a C programmer can make that will
> give rise to all sorts of program bugs including buffer overruns,
> pointer overruns and underruns and many more.
Same with C++. *shrug*.
> There are uses for C; it was originally designed for programming
> operating systems and such, and really is not well-suited at a
> general-purpose programming language.
> The act you _can_ write almost any program you can conceive in C doesn't
> mean you should do so.
The fact that you *can* write bad programs doesn't mean you shouldn't learn
a programming language.
> C doesn't do strings.
> C doesn't do fixed-point.
> Both are needed in business applications.
"Doesn't do" isn't correct at all. "Doesn't have as a language feature" is
better. And of course, C *does* have strings of a sort.
Anyway, with open source, there are good libraries out there to do both.
>
> C++ is another matter altogether, and provided programmers use the C++
> features, code written in C++ is likely to be more reliable than
> equivalent code written by equivalently-capable C programmers.
It's not *all* altogether a different matter, but generally, yeah, this is
why I advise getting a good book that teachs C++ as an object-oriented
langauge from the ground up rather than as a stepping-stone from C.
--
Matthew Miller mattdm at mattdm.org <http://www.mattdm.org/>
Boston University Linux ------> <http://linux.bu.edu/>
Current office temperature: 72 degrees Fahrenheit.
More information about the fedora-list
mailing list