Thursday, May 15, 2008

Hello World C/Cpp Program Simplified

Recently I just wrote my first itsy bitsy little program called “Hello World”. Well, actually it was more of a cut & paste experience for me. Anyway, I spent a few hours trying to figure how to work the DevC++ compiler; a free & easy-to-use compiler uses a Windows interface. I downloaded & installed it recently from Note* You may want to download the top most option on the site which is the newest version. You can also opt for the NetBeans IDE versatile compiler; it works with Java & Ruby too!

Hello World Open New File Source

No problems with installing it; same for other windows applications. Firstly, the compiler will look as boring as a Windows 95 predecessor. So, the first thing for you to do is to find a place to write the code. Open a source file by clicking on the rectangular that looks like a 2 dimensional flat piece of paper (shown in below figure). Its ok, it took me quite a while too.

How it took me so long to do the “Hello World” program was because I was reading the tutorial at which was sourced from Yes scrutiny is necessary to actually find good quality tutorials on the sites. The more tutors options the better to help keep your self open minded so you may want to find some good ones. The tutorial is to look at the Hello World program’s structure & the tutorial won’t tell you that you the codes won’t work in DevC++ because the code is not finished.

Yeah, the two sites deserve the blame. You fortunate reader can simply go to the C:\Dev-Cpp\Templates & open the Hello_cpp or Hello_c file. Cut & paste the codes in each file into the DevC++ on to two separate source files. You may want to do both so that you can basically see the difference between C coding & C++ coding. Click on Execute then Compile & Run. Send it to your desktop so you can click on the applications whenever you want to feel good about having made your first C & C++ programs!

No comments:

My latest images for sale at Shutterstock:

My most popular images for sale at Shutterstock: