Talk:C Programming/Preliminaries

Functions can be within functions
All functions are global (i.e. a function cannot contain another function. This is why C is not a traditional block-structured language).

That's not true. Try compiling: int main (void) { 	void hw (void) { printf ("Hello World!\n"); } 	hw; { 		return 0; } }
 * 1) include 

A thing 23:43, 26 December 2005 (UTC)


 * It is true for Standard C (i.e. ANSI/ISO C). Try compiling your code with gcc using  and you will get:

In function `main': warning: ISO C forbids nested functions

Don't teach the wrong usage of printf
This page uses the famous  which is the source of all trouble with format string bugs. Please do not teach people that printf is a "function that prints its argument". Use something like. If you don't want to explain printf at this point, use. -- 131.130.38.57 15:03, 21 September 2005 (UTC)


 * I'm not sure of your point here. Why is the example the "source of all trouble with format string bugs"? The specification says that  writes output to , under control of the string pointed to by its first argument that specifies how subsequent arguments are converted for output. In the "Hello, world\n" case, the only formatting required is the translation of   into a newline, all other characters are copied to  . -- Mickraus 12:51, 29 October 2007 (UTC)

Scope
The concept of scope can be a little confusing at first, perhaps this should be moved to a later section? I'm going to add in some examples to help people understand the idea now, but someone might want to move the section somewhere else. CharmlessCoin (discuss • contribs) 01:27, 19 February 2013 (UTC)

wiki breaks appear in pdf e-book
In the third example of white space there are three occurrences of , all appear in the pdf e-book and can easily confuse readers. --Mfillpot (discuss • contribs) 04:30, 5 May 2013 (UTC)