Beruflich Dokumente
Kultur Dokumente
Esperanto or Quenya(Tolkien)
A programming language is defined by a set of certain rigid rules, much more
inflexible.h
Lexicon: determine symbols that could be used.
Syntax: determine the appropriate ways of collating the symbols.
Semantics: helps us to recognize the meaning of every statament expressed.
First program in C
"#" means that the following line is a preprocessor directive (separate from the
compiler) and pre-read the text of the program and make some modifications.
Preprocessor are controlled entirely by its directives.
"include" is a directive and replace the directive with the file that follows.
Those changes aren't made in the source code, instead are made on a volatile copy
(dissapears after compiler finishes its work).
".h" header file that provides information of the file.
"studio.h" contains a collection of preliminary information about ready-made blocks
(used to write or read text).
"functions" are blocks used to build C programs.
"functions arguments/parameters" is the input data.
"results" output data.
"main" function which always has to appear.
Every function: result,name, parameters and names. This is called "Prototype"
"body" the interior of the function. Start with a opening bracket and end closing
it "{}"
"function invocation": called functions on the code.
Each instruction must end with a semicolon ";".
Each function must have a pair of parentheses, no matter the parameters.
Strings are always enclosed by quotes.
The main functions pauses itself when another function is invocated.
Can write more than one statement per line.
"return" statement that causes the end of the function execution.
"return 1" something went wrong.
"Variables" are containers to store data. those must have name, type, value.
Restrictions for the varables' name:
-composed of upper-case or lowe case latin letters, digits and the character.
-begin with a letter.
-underline character is a letter
-upper and lowe-case letters are treated as different.
Comments
2. Floating-point numbers.
Use scientific notation to large numbers with letter "e#" or "E#". The exponent has
to be an integer and the base could be whatever.
Operators
"Operators": able to operate on the values
"*" multiplication
"/" divisional
Division by zero is forbidden.
"+" plus
"-" substraction or changed the sign of a number.
higher +- unary
*/%
lower +- binary
Postfix operators
++: increment operator
--: decrement operator
Those can be used before the variable.
Priority table
++ -- + - unary
*/%
+ - binary
=
Character type
all strings are treated as arrays.
"char" to store and manipulate characters.
Character literals
'\\'
"==" equal to
"=" assignment operator (left-side binding)
"=!" not equal
">" greater than
">=" greater than or equal
"<=" less than or equal
Priority table
++ -- + - unary
*/%
+ - binary
< <= > >=
== !=
= += -= *= /= %=