Criticism of the C programming language: Difference between revisions

Content deleted Content added
Economy of expression: there might not be actual "arrays"; bounds violation is already mentioned (more than once)
Line 84:
 
==Economy of expression==
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 examplefunction failsassumes ifthat thethere arrayis <code>t</code>sufficient bespace largeravailable than <code>s</code>, a complication that is handled byat the safer library function <code>strncpy</code>destination.</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)