Don't miss

Sunday, 1 September 2013

Colour Scheme For Codes

By on 6:09:00 pm

Coloring Scheme
You must have noticed that we use different colours/colors in our codes.Its basically to differentiate between the "common code" necessary in every program and the "target code" specifically for the purpose we are programming for.In a layman terms"Different colours ,different purpose"

So here they are

  1. Blue     
This is for libraries. These are basically components(parts) of C++ that store different types of operator. This can be explained by an example :-  A construction worker requires a toolkit containing screws,wrenches,hammers etc. Similarly a medical officer requires a first-aid kit with bandages,medicine etc.
Here the kit can be taken as a library and the kits content ,the operators.

So there are libraries for input and output command , math commands ,clearing screen etc.
Note that here three main libraries are used;-
#include<iostream.h> ==> Necessary for input and output 
#includes<conio.h>     ==> To clear the Dosbox of previous writing when running programs(Clear-screen)
#include<math.h>       ==> For mathematical operators like square root.

    2. Green

For main() function that tells that the program is starting from there, and other basic functions that have the bracket () sign.

    3. Red

For the comments of-course , and some practical jokes too.

That's it.
P.S: Right ,in a "long" post we (me and DW) don't colour after the first 2-3 codes,as colours are just for a basic feel.


Post a Comment