Saturday, January 24, 2009

Other Blogs

Learning Computer Programming
A very good blog for learning some good languages like C++, HTML, JavaScript etc. The blogger writes very good material and explains the code very well. Perfect for beginners and amateur programmers.

Smart Programming
Cool blog which helps solving programming problems as well as other computer software problems.

Saturday, January 17, 2009

Lesson 2: Input and Output

Level: Beginner

In this lesson we will discuss taking input from the user and giving output to the user in C++. Remember that if you know these basics you can skip them.

We will later be programming using a software called 3D GameStudio. Please click here to download a free trial version of 30 days. Its around 50MB. You have to buy the software if you want to make commercial games with it.

As I have told you in Lesson 1 that you have to include the files 'iostream.h' and 'conio.h' if you have to use input and output in your program.

The command for input is 'cin' followed by '>>' and then followed by the name of the variable you wish to store the input in. 'cin' stands for console in.

The command for output is 'cout' followed by '<<' and then followed by what string you want to print on the screen. 'cout' stands for console out.

Click here to download an example.

In the example, we first include the files 'iostream.h' and 'conio.h'. Then, we start the main function. Then, we introduce characters named as 'name' (command: 'char') followed by []. [] brackets mean that the user can enter infinite amount of characters. If you want to limit the user, you can write some value in it. After that, we give an output to the user to write his/her name, which is stored in value 'name'.

Then, the screen is cleared and output is given.

Friday, January 16, 2009

Lesson 1 Download

I have uploaded the code for lesson 1. It is a text file. I had to upload it since blogger did not let me write code in C++. Anyway, the download link is given below. I'm afraid you will have to see the explanation from lesson 1 post in this blog. Thanks!

http://www.4shared.com/file/80893345/67a959e0/helloworld_C.html

Friday, January 9, 2009

Sorry for the last post

Blogger doesn't let me write some things in C++. I will try to solve this problem or I will post a text file. Screw Blogger!!!