The real C++ : c99 standards
by mage on Aug.31, 2009, under Programming
Well many of us have already done c++ programming and many would be doing it.
C/C++ doesn’t really matters, what matters is the compiler. People teach and learn basically on TurboC compiler.
Whats wrong with TurboC:
Well TurboC compiler is one of the earliest c/c++ compilers and still hasn’t grown much. It still works on 16-bit compiler(we have 64bit PCs these days). It follows old c/c++ standards c89 or c90, now these are old.. we have c99 as current standards for writing c++ codes.
Which Compiler to Use:
Well there are a lot of 32/64 bit compilers available to use, best ones being visual c/c++ and gcc/g++. Since we follow open source i’d recomend gcc/g++ to compile your programs. For people who don’t like command line interface of gcc/g++ can use DevC++ software to compile it.
These are available as 32/64 bit compilers (according to the type of pc you are using and operarting system) and follow latest c99 standards.
How does this difference effect me:
Well running a 16bit compiler on a 32/64 bit machine tells to the fact that it isn’t as capable of processing like the rest. Also noting that the previous standards weren’t perfect and had loop holes into it, so a need of better standards always comes up for improvement and c99 is just a good improvement.
Later on you’ll find no c/c++ code is developed on TurboC.
Is The Code for c99 different:
Well somewhat yes and no, I mean c/c++ won’t change, except some ways to refer things do change.
Now i’ll explain the difference in codes :
1. The is no iostream.h header file to include instead you include iostream file.
#include<iostream>
2. You cannot refer cout and cin statements as it is, you need to point it to std for standard I/O.
cout<<"Hello"; becomes std::cout<<"hello";
3. If you don’t want to write std everytime you can use the namespace concept to point it to standard by default.
eg code :
#include<iostream>
using namespace std;
int main()
{
cout<<"hello";
return 0;
}
4. There is no conio.h -> conio.h is a dos based header file and cannot be used except TurboC.
you can use alternatives to the major functions you used there.
getch() -> getchar()
clrscr() -> system(“cls”); //windows
clrscr() -> system(“clear”); //linux
5. The is no void main… your main function should always return a value, so we go with int main.
Keeping in mind only these few things you’d be programming better than the rest and one step above them.
3 Comments for this entry
2 Trackbacks / Pingbacks for this entry
-
TODD
July 16th, 2010 on 1:45 amBuy:Zovirax.Prednisolone.Synthroid.Prevacid.Valtrex.Nexium.Zyban.Human Growth Hormone.100% Pure Okinawan Coral Calcium.Actos.Accutane.Retin-A.Lumigan.Mega Hoodia.Arimidex.Petcam (Metacam) Oral Suspension….
-
RON
July 22nd, 2010 on 3:52 amBuy:Accutane.100% Pure Okinawan Coral Calcium.Lumigan.Petcam (Metacam) Oral Suspension.Synthroid.Human Growth Hormone.Valtrex.Zyban.Arimidex.Mega Hoodia.Nexium.Actos.Retin-A.Prevacid.Prednisolone.Zovirax….
September 1st, 2009 on 1:14 am
Great work mage till now majority of students are working on turbo c++(16 bit compiler) compiler which is not compatible with c99 standars and is not capable of handling big projects.So this will help in developing their programing skills and getting out of old compilers and text editors and start using open source compilers and text editors like dev c++(32 bit compiler).
September 6th, 2009 on 11:38 pm
u r doing a great job friend.
October 27th, 2009 on 5:37 pm
thanx buddy ,,,, this was quite useful..