Alex Rivera | Logout

Where can I find resources about "modern" C programming?

Asked 2011-06-10T14:04:57.633
12

In spite of having read K&R, and having even taught C classes, I find myself embarrassingly unable to fully understand what one might call "modern" C.

There seems to be many unwritten conventions in modern programming that, as far as I know, aren't documented anywhere.

Take, for example, the SQLite source code. In it I find for instance:

 SQLITE_API int sqlite3_close(sqlite3 *);

What does SQLITE_API stand for? How is this even syntactically correct?

Or this:

#ifndef _SQLITE3_H_
#define _SQLITE3_H_

Is there an accepted convention somewhere on when to prefix macros with underscores? Sometimes I see macros prefixed with two underscores.

Or what about the use of fixed-size types, such as uint32 and so forth. When should one use this practice, and when not? What about the new-ish bool type, when should it be preferred over simple ints?

These are some of the questions I pose myself when I read other people's source code. Is there a reference somewhere that might help me answer these questions?

c
Edit
Report

1 Answer

0

I would recommend "C Interfaces and Implementations: Techniques for Creating Reusable Software" by David R. Hanson. I think this is one of the best book about use of C language.

answered 2012-02-23T19:11:11.037

Your Answer