Basic C++

Today you will learn Basic C++ in 5 minutes.

Step 1: What You Will Need

A Mac with terminal, or on any computer go to on any computer. And your imagination

Step 2: Only If You Are Starting in Terminal, Getting to the Editing Platform in Terminal

The first thing you will need to do is make a folder on your desktop, call it anything you want, this is where your c++ projects will go.

Step 3: Getting to Your New Folder From Terminal, ONLY FOR PEOPLE WITH MACS

Now, you will need to open terminal and type in this, cd ~/Desktop/[Name of the folder] pwd

Step 4: Getting to Nano(fancy Word for Editing Software in Terminal), FOR MAC PEOPLE ONLY,

Congrats you are now in your folder on your desktop. now type in nano test1.cpp,

this will create a file named test1.cpp and bring you to the editing software for editing test1.cpp

Step 5: Putting Your Heading/ Starting Code In, FOR EVERYBODY,

now that you have your nano up in terminal, and for those of you not on a mac, in You have to insert a heading, in codechef, they already put in for you, but it is good to know and also nano does not start with it.

This is what you should put in,

#include <iostream>

using namespace std;

int main()


return 0;


, this is what will make your code run.

Step 6: Making Hello World

Now that we have our starting code, lets start the real program.

#include <iostream>
using namespace std;

int main()


//everything in the brackets is code, but when you put two slashes the code ignores that line insert the codebelowthis

cout << " Hello World" << endl;

return 0


Step 7: How to Run It

For those of you in codechef, press the run button in the bottom right. And the output should be Hello World. But for those of you in nano, type in the following:

do control o,

press enter,

do control x,

type in in the regular terminal not nano, type in make test1,

than type in ./test1

it should than run



    • Sweet Treats Challenge

      Sweet Treats Challenge
    • Remix Contest

      Remix Contest
    • Warm and Fuzzy Contest

      Warm and Fuzzy Contest

    3 Discussions


    2 years ago

    Your Welcome, If anybody would like me to make more c++ videos, please comment back. (It doesn't matter if it is a a year later, pls comment back)

    1 reply

    Reply 1 year ago

    What is a good book or a good way to learn more about C++ for a beginner?

    I have read through some books and searched on line for information and let me say I have read through "hello world" many times. I would like to see something more complex and cooler that you can do with C++ and how to do it with great explanations of all the steps.


    2 years ago

    Thanks for breaking this down!