Expert C Programming
Available Hardware Is a Crayon? One new feature introduced with ANSI C is the convention that adjacent string literals are conca ...
rationale is that it makes automated generation of C easier. The claim would be more credible if trailing commas were permitted ...
function apple (){ / visible everywhere / } extern function pear () { / visible everywhere / } static function turnip(){ / not v ...
extern Applied to a function definition, has global scope (and is redundant) Applied to a variable, defined elsewhere void As th ...
p = N sizeof q; Quickly now, are there two multiplications or only one? Here's a hint: the next statement is: r = malloc( p ); ...
Most of these become more understandable if you sit down to consider them at length. The case involving the comma occasionally c ...
'And' and 'AND' or 'Or' or 'OR' From decvax!harpo!npoiv!alice!research!dmr Date: Fri Oct 22 01:04:10 1982 Subject: Operator prec ...
the order in which these groupings will be evaluated is always undefined. In the expression: x = f() + g() * h(); The values ret ...
we find that, since the expression only involves the assignment operator, precedence does not help us understand how the operand ...
Here, line is a 512-byte array allocated automatically on the stack. When a user provides more input than that to the finger dae ...
Sins of Omission The "sins of omission" category covers things that the language doesn't do that it should. This includes missin ...
In this case, the argument processing would make the mail program think it was being asked to read mail, not send it. Bingo! E-m ...
Some C programmers have adopted the convention that an argument of " -- " means "from this point on, no arguments are switches, ...
Yet a third white space problem occurred when a programmer had two pointers-to-int, and wanted to divide one int by the other. ...
It was originally thought that the // comment convention would not alter the meaning of any syntactically correct C code. Sadly, ...
/ convert the tm struct into a string in local format / strftime(buffer, sizeof(buffer), "%a %b %e %T %Y", tm_ptr); return buffe ...
This solves the problem of anyone overwriting the string. Only routines to which you give a pointer will be able to modify this ...
Lint Should Never Have Been Separated Out You'll notice a consistent theme running through many of the above problems: lint dete ...
explicit cast, or lint comment, but there were several real bugs shaken out by the process: Argument types transposed between f ...
We have long felt that programmers working on real-time control systems should have the privilege of taking the first ride on th ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf