C became known ANSI C since Brian Kernighan and Dennis Ritchie published the official documentation. C is written like most languages in statement per line basis and terminated with a semi-colon.
#include <stdio.h>
int main(void)
{
printf("hello, world\n");
}
So the above program is going to output:
hello, world
Operators
C has operators can be used to program a computer:
- arithmetic: +, -, *, /, %
- assignment: =
- augmented assignment: +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=
- bitwise logic: ~, &, |, ^
- bitwise shifts: <<, >>
- boolean logic: !, &&, ||
- conditional evaluation: ? :
- equality testing: ==, !=
- calling functions: ( )
- increment and decrement: ++, --
- member selection: ., ->
- object size: sizeof
- order relations: <, <=, >, >=
- reference and dereference: &, *, [ ]
- sequencing: ,
- subexpression grouping: ( )
- type conversion: (typename)
Datatypes
Each programming language defines memory allocation of set of data into types. The data types are define in the compiler but can be overridden by the program using typecasting in C.
No comments:
Post a Comment