CT GunZ Server
Would you like to react to this message? Create an account in a few clicks or log in to continue.
CT GunZ Server

CT GunZ EN-Forums
 
HomeHome  PortalPortal  Latest imagesLatest images  SearchSearch  RegisterRegister  Ger Forums  GunZ Register  Server  VOTE please  Be Donator  Download CTGunZ  Log inLog in  

 

 Coding TuT 4

Go down 
3 posters
AuthorMessage
bossxd
BANNED
BANNED
bossxd


Male

Number of posts : 21
Location : usa
Points : 64
Character : Noname
GunZ Exp (nub/pro) :
Coding TuT 4 Left_bar_bleue0 / 1000 / 100Coding TuT 4 Right_bar_bleue

Registration date : 2009-04-12
Reputation : 0


Coding TuT 4 Empty
PostSubject: Coding TuT 4   Coding TuT 4 EmptyTue Apr 14, 2009 10:40 am

What is syntax?

Helping the computer understand your intentions

C is a language like any other - in order to make yourself understood, there are rules and conventions to follow. These rules are termed syntax. In a human-human conversation, ambiguities are reduced by body language, tone, context and experience but ambiguities often remain and mistakes are common. Computer languages need to be precise about the meaning of any statement. Ambiguities and confusion cannot be allowed and this is where syntax errors appear.

#include
main() {
printf("%s","Hello World!\n");
}

Probably the simplest of all C programs. Line by line:

. . include the standard input/output library header file
. . all C programs need a main function
. . print a formatted string to the default output
. . close the main function block
Include the standard I/O library
Every program needs some basic methods - receiving input from the keyboard or files, producing output to the screen or to files, arithmetic, conversions and other functions. stdio.h provides the definitions of the basic methods of input and output for the screen, files and memory. The code to implement each one is built in with the compiler.

All C programs need a main function.
The function starts with a definition giving the name of the function. You can use your own function names but the OS will start execution of the program by calling main() so the file will not compile without one. As with other languages, functions can take arguments within the parentheses - in this example, main doesn't take any arguments. It is common for this first line of the function to also open the function block that contains the code to execute when the function is executed.

print a formatted string to the default output
printf can handle all your general purpose screen output. (Alternatives like cout
Back to top Go down
Snake
Retired Staff
Snake


Male

Number of posts : 3572
Age : 31
Location : UK
Points : 3473
Character : Coding TuT 4 Snake11copy-1
GunZ Exp (nub/pro) :
Coding TuT 4 Left_bar_bleue99 / 10099 / 100Coding TuT 4 Right_bar_bleue

Registration date : 2009-02-02
Reputation : 27


Coding TuT 4 Empty
PostSubject: Re: Coding TuT 4   Coding TuT 4 EmptyTue Apr 14, 2009 2:48 pm

Nice...
Back to top Go down
Tittenfee
Retired Staff
Tittenfee


Warnings : 2.99
Male

Number of posts : 2522
Age : 30
Location : Austria, Vienna
Points : 2583
Character : Tittenfee, _NPC_
GunZ Exp (nub/pro) :
Coding TuT 4 Left_bar_bleue69 / 10069 / 100Coding TuT 4 Right_bar_bleue

Registration date : 2009-01-22
Reputation : 22


Coding TuT 4 Empty
PostSubject: Re: Coding TuT 4   Coding TuT 4 EmptyWed Apr 15, 2009 9:47 am

cool *spams with snake together*
Back to top Go down
Sponsored content





Coding TuT 4 Empty
PostSubject: Re: Coding TuT 4   Coding TuT 4 Empty

Back to top Go down
 
Coding TuT 4
Back to top 
Page 1 of 1
 Similar topics
-
» Coding TuT 8
» Coding TuT 9
» Coding TuT 10
» Coding TuT 11
» Coding TuT 12

Permissions in this forum:You cannot reply to topics in this forum
CT GunZ Server :: Basket-
Jump to: