Criticism of the C programming language: Difference between revisions

Content deleted Content added
THB (talk | contribs)
categorize
m remove parens from function name
Line 43:
 
===Economy of expression<ref>The heading of this section is borrowed from the first sentence of the preface to the first edition of Brian W. Kernighan and Dennis M. Ritchie: ''The C Programming Language,'' reprinted in 2<sup>nd</sup> ed., p. xi.</ref>===
One occasional criticism of C is that it can be concise to the point of being cryptic. A classic example that appears in K&R<ref>Brian W. Kernighan and Dennis M. Ritchie: ''The C Programming Language,'' 2<sup>nd</sup> ed., p. 106. Note that this example fails if the array <code>t</code> be larger than <code>s</code>, a complication that is handled by the safer library function <code>strncpy()</code>.</ref> is the following function to copy the contents of string <code>t</code> to string <code>s</code>:
 
void strcpy(char *s, char *t)