Lesson 1: A First Program
In this lesson, we closely analyse the program I copied and pasted in last time. I aim to explain how each element works – at a basic level at least – and why we use it. To finish up, I add a few extra lines to consolidate our new knowledge and introduce one or two additional features.
If you want to share your opinions, suggestions or corrections, you can comment on the video on YouTube or comment on the page here.
Source Code
The source code featured in this video was as follows:
#include <iostream>
int main()
{
// write output to the console
std::cout << "string literal here";
std::cout << std::endl;
std::cout << "Because we're all tired of 'Hello World!'" << std::endl;
// write some more output
std::cout << "consectetuer adipiscing elit." << std::endl;
std::cout << std::endl;
std::cout << 45 << ", " << 3.14 << "." << std::endl;
std::cout << 45 << "45" << std::endl;
std::cout << "this is a string literal" << '!' << std::endl;
return 0;
}
Comments (0)
Leave a comment
