Login Register


Introduction to C Programming [Part 2: your first program] filter_list
Author
Message
RE: Introduction to C Programming [Part 2: your first program] #4
(01-14-2015, 08:22 AM)DAKIMAKURAFAN2008 Wrote: Serious question, as every statement needs to be followed by a semicolon and functions must be within braces, why is the following not syntatically correct?\

Code:
#include <stdio.h>; {; int main(int argc, char* argv){; printf("Hello World!); return 0; }; };

A semicolon by itself is a statement. It just happens to compile to nothing.

example:
Code:
for (;;);

is the EXACT SAME AS
Code:
while (1) {}






Messages In This Thread
RE: Introduction to C Programming [Part 2: your first program] - by phyrrus9 - 01-14-2015, 06:56 PM



Users browsing this thread: 1 Guest(s)