(OBSOLETE) C Language Programming Resources (OBSOLETE)
IDAllen Tip Jar:
This is an obsolete circa year 2001 page that deals with programming in C.
Many of the links and advice are decades old and broken.
Some are timeless. You have to figure out which is which.
If your program is clear you can make it correct.
Can you be sure your program is correct if it isn't
clear?
- J. Blustein <jamie@csd.uwo.ca>, How
to Debug.
These first items are selected to be of use to people writing
programs in the Algonquin environment in 1999.
Help with debugging
Use of the MEM package is made obsolete with the VALGRIND software under Linux.
You can make sure all your malloc/free function calls are
matched by using the MEM software package. It replaces
these C Library function calls: malloc,
calloc, realloc,
strdup, and free.
Select here for details. You can
pick up the software itself by selecting
here.
Modern environments use valgrind to
debug memory leaks.
A program is a sort of publication. It's meant to be
read by the programmer, another programmer (perhaps yourself a
few days, weeks or years later), and lastly a machine. The
machine doesn't care how pretty the program is - if the program
compiles, the machine's happy - but people do, and they
should.
This points to many useful topics about C programming,
including a bit of C history such as the B programming language
that I used before I learned C: B didn't believe in
typechecking, period. There was only one type, the machine
word, and the programmer was responsible for applying to a
variable only such operators as made sense.
C on the World Wide Web
Steve Summit's Introductory C course. (highly recommended [back in 1999]!)
MOVED? www.ltam.lu/ourpages/staff/fabfr/cours-c/Introduction a la programmation en ANSI-C by H Faber, (French).
MOVED? www.pottsoft.demon.co.uk/c_course/course.htmlPhil's C Course by Phil Ottewell.
MOVED? cs.wpi.edu/~cs1005/Introduction to Programming in C at Worcester Polytechnic Institute.
MOVED? www.iftech.com/classes/c/c0.htmIntroduction to C Programming by Marshall Brian.
MOVED? www.strath.ac.uk/CC/Courses/NewCcourse/ccourse.html C Programming by Steve Holmes, University of Strathclyde.
MOVED? www.cit.ac.nz/smac/cprogram/ C Programming at the Central Institute of Technology, New Zealand.
MOVED? www.wco.com/~ejia/EDU/program1.htm C and C++ resources by E.J. Inglis-Arkell.
MOVED? www.syndell.demon.co.uk/derekh/cside.htm The C Side by Derek Harper.
MOVED? www.aplus.net/docs/facts/programming-and-unix-tutorials.htm Programming and Unix tutorials
MOVED? A mirror of www.gnacademy.org:8001/uu-gna/text/cc/Introduction to Object Oriented Programming Using C++: a tutorial on programming in C++, sponsored by the www.gnacademy.org:8001/uu-gna/ Globewide Network Academy [GNA] of free Internet courses
MOVED? www.eskimo.com/~scs/C-faq.top.html Frequently Asked Questions about C programming.
MOVED? www.andromeda.com/people/ddyer/topten.html Ten Gotchas of the C language
MOVED? www.snippets.orgThe SNIPPETS collection of C/C++ code by Bob Stout.
Security Issues in C Programs
The Internet is full of security incidents arising from
code that forgets to check for buffer overflow. This is a serious
programming error, and I don't accept student code that does not
protect itself against overflowing its own internal buffers.
Check the size of the buffer before you append anything to
it!
Buffer overflows appear to be the most common problems
reported
in May, with denial-of-service problems a distant second.
Many
of the buffer overflow problems are probably the result of
careless
programming, and could have been found and corrected by the
vendors,
before releasing the software, if the vendors had performed
elementary
testing or code reviews along the way.