Tuesday, December 5, 2006

Beginning C++ Programming: Lesson 1

This week's video covers how to create your first C++ program. Hello World is usually always the first thing that is taught in a programming class because its a very basic program but also gives the student a feeling of actually creating something. Below are links to the youtube video and a link to download the video from megaupload since youtube really kills the quality of the video.

Youtube Link:
http://www.youtube.com/watch?v=K5HdaQ5b9cQ

Megaupload Link:
http://www.megaupload.com/?d=DKZOUNJ5

Lesson 1 Source Code:
http://www.megaupload.com/?d=QST91O38

Video Explanation:

In the video I mentioned the header file called iostream this has to be included into any program that requires input and output if you don't put this header file in your program your compiler will give you an error that says:

'cout' : undeclared identifier

this just means that the object "cout" can't be found because the header file in which it is contained doesn't exist. When you download the source file try doing this comment out the #include line and see what you get.

BTW I forgot to mention on the video but you create comments by just adding // in front of the line you want to comment out if you are using Visual Studio the line should now turn green.

cout and inseration operator:

cout is the output object in the iostream header file it just tells the compiler to output the data that is being inserted into the output stream. The insertion operator "<<" is what actually inserts the value into the output stream buffer. You can have pretty much any type of value here you want. If its a string it must be enclosed in quotes as in this example but you can also output variables which I will cover next time.

The return 0 statement just tells the main function to return the value of zero to windows. The Zero value just means that your program has ended smoothly.

All C++ statements must end in a semicolon!!!


Next Week's Video:

I will expand on this example and show you how to get input from a user and explain what variables are.

20 comments:

chaulky said...

I think this is a great idea, video C++ tutorials. Definitely need to get the video quality better on youTube though so you can see the code.

Seth Wain said...

Use Google-video the quality up there doesn't change(atleast not that i remember), or you could use an web server to not change any quality at all streaming from your web server, but still, nice idea with the C++, this convinced me to go back to the good old c++ and C#. keep up the work

InterstellarSky said...

Awesome Idea, It encouraged me to start learning C++, but im gonna follow you to it!! C++ Rules!

Anonymous said...

Nice video, but I'm a bit past hello world now,

Nirvana said...

Waiting for videos

Secure said...
This comment has been removed by the author.
Secure said...

Great idea and first video Tracy. I am in my second week of a C++ intro class so your videos will probably help me.

I agree though that the video quality is not very good. Although, if you post the source code it's not that big of a deal.

Thanks, keep up the good work.

Siro V said...

I hope to see Lesson 2 soon!!

Jackie said...

What a great idea! Thanks! :D

Rakesh said...

very nice.thank you sooooooo much. appreciate your help but cud u pls put a clear video? .. it isnt so visible even in full screen


thanks :)

workplace psychopath said...

very nice

workplace psychopath said...
This comment has been removed by the author.
Officers: said...

heyy thats good! :) its been really helpful, really interesting. very intresting thx :)

Officers: said...

hey! thats really really cool. n great personality as well!

very interesting keep it up girl :)

Unknown said...

i think this is a great idea

Unknown said...

xcept you know..i don´t like weeaboos

Unknown said...

Hey dude, this is nice, im really really lost right now, and im in Programming II now... need lots of work... but i cant find the rest of the videos... where can i get them??

polly said...

I like your video tutorials. I am learning C++ now. Also I am interested in Asian culture, know little Japanese. I am from China, living in Ohio now...

Anonymous said...

Count me in I want to Learn C++

Anonymous said...

By way I love .. LOVE LOVE Japanese cartoons ... right now I watching Death Note from DVD's.

I dig the language too it's Ausom.