Saturday, June 15, 2013

Programming in C - 1. Fundamentals

C  is a general-purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. ( Source : Wiki )
Middle Level Language
Portable
Structured language.

The C grammer :

  1. Charecter set : used to form words, numbers and expressions , in any programming language. It includes Letters, Digits, Special charecters
  2. Token : Fundamental units of C language. It include  Identifiers, Keywords, Literals, Operators, white Spaces.
    • Identifiers : Name of variable , a constant or a function.
    • keywords : C has almost 32 keywords. They are reserved words which cannot be used for naming variables.
    • Constants : It is the Value of Quantitiy.
  3. Data Types : It is used to determing the kind of data the variable can store. It has four basic data types int, float, char and void.
    • Integer : these are numbers without decimal part that may or may not be prefixed with a negative sign.
    • Float : These are numbers with decimal part in it.
    • Void : It has no value. It can be used to declare a funtion that retuns no values, it creates generic pointers.
  4. Operators : An Operator is a symbol that tells the compiler to perform specific mathematical or logical manipulation.
    • assignment : =, ==
    • auto increment / decrement : ++, --
    • ternary : (x>y)?x:y
    • logical : && (AND), || (OR), ! (NOT)
    • relational : <, >, <=,>=
    • cast : (type_name) expression
    • arithmetic : +, -, %
    • bitwise : &, |, -(compliment)
    • special

Next : Programming in C - 2. Input and output Operations

No comments:

Post a Comment