Sunday, February 10, 2013

C/C++ Programming: Keywords

There are some reserved words in C language whose meaning is predefined in C compiler. We cannot use a keyword as a variable name. Keywords can be for specific purpose. Assigning a new meaning for keyword is not allowed. Mixing up variable names with keywords will create compilation error.

32 keywords are used in C. The following figure gives you a ready reference for C keywords. These keywords are all lowercase. Since upper case and lowercase characters are not considered same in C, we can use an uppercase keyword as an identifier. But it is not considered as  good programming practice.

 C programming keyword list

Saturday, February 9, 2013

C/C++ Programming : Identifier names

Identifiers are the names which are used to reference variables, functions, labels and user defined objects. Valid length of an identifier is 1 to 32 characters. The first character of an identifier must be a letter or it can be an underscore with subsequent characters including letters numbers and the underscore. We can use $ in an identifier name but use of $ is not recommended. Let’s have a look on the example of correct and incorrect use of identifier names.
Identifier names are case sensitive.  HELLO, hello and Hello are three different identifiers. We cannot use C keyword as identifier and it cannot be same as standard library funtions.

Friday, February 8, 2013

History of C/C++ Programming

The C Programming Language
C programming first book cover
C programming language is one of the best programming languages. This is a general purpose programming language which was initially developed by Dennis Ritchie between 19969 and 1973 AT&T Bell Labs.
Ken Thompson and Dennis Ritchie
Ken Thompson and Dennis Ritchie,
developers of the C programming language.

This language was designed to construct a map efficiently to typical machine instruction.  C  is influenced by  B (BCPL, CPL), ALGOL 68, Assembly, PL/I, FORTRAN and it influenced numerous languages as AMPL, AWK, csh, C++, C--, C#, Objective-C, BitC, D, Go, Java, JavaScript, Limbo, LPC, Perl, PHP, Pike, Processing, Seed7. C is the most widely used language and most of the computer architecture depends on it.  C is a procedure oriented programming language. A book by Dennis Ritchie and Brian Kernighan was most used as reliable source for informal specification many users and implementers, before there was an official standard for this language. Bjarne Stroustrup began work on "C with Classes"  for improvement of C . The first C with Classes compiler was known as Cfront. Cfront was used to translate C with classes to ordinary C. In 1985 C was entitled to C++ programming language. ++ is an increment operator in C. So, it makes clear that C++ is an upgraded version of C with object oriented programming concept. But then there was no reference for this language. In the year of 1990 ‘The Annonated C++ Reference manual was released. In the same year Turbo C++ compiler was commercially released last stable release was in 2006. This compiler is still widely used. Later different version was introduced by International C++ standard committee as C++ 98 in 1998, C++ 03 in 2003, C++0x in 2005.
In mid 2011 latest version of C++ was introduced which is known as C++11 . Important feature of C++11 is comprehensive randomization of library, standard threading library, atomic support, a  for loop syntax which works as foreach loop in certain other languages,  better support for structure unions and array initialization .