Learning C++ - Part 2 - Writing your first C++ program
Hello everybody, it is "Not Funny" with another post about the C++ Language.
I really recommend you to visit my previous post it will show you how to download Code Blocks and as a reminder download the IDE from here and choose this setup.
Any setup but that won't work correctly.
Writing your first C++ program!
First of all, click the add button so our file can be visible, same for "source" and you gonna find a text file called 'main.cpp' (by the way cpp = c++) double click on it and you gonna something like this.
And because you are new to the C++ language just modify it to this so it can be much simpler to deal with.
Understanding the code
- First of all let's try to understand the first line.
"iostream" is header that defines the standard input/output stream objects, think of it like a box that contains things called methods (you might not understand what is a method but we will talk about it more in future posts.
is a function wich will cover in future posts but for now all you need to know about it is that it is from where the execution of the code starts, if main isn't present your code won't run.
std::cout is a method that exists in the header "iostream", it basically allows us to print text in the console, for example the output of our code will be :
std::endl means that it is the end of the line so any syntax wrote after it will be in the next line.
we will talk about "return" more in the futur, the code, by convention, expects your main() to return 0 on success, and any other value on failure.
This is all for today's post, upvote if it helped you, and ask questions if you didnt understand something in the comment section.
See you later!
Congratulations @pentest1002! You have received a personal award!
1 Year on Steemit
Click on the badge to view your Board of Honor.
Do not miss the last post from @steemitboard:
Congratulations @pentest1002! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!