Hey guys, axtyax here!
and today we will be beginning c++!
C++ is probably the most powerful programming language out there, and is constantly updated!
Some of the uses of c++ are
*WARNING c++ is not simple, but with some practice, you can make so many on your computer that you will regret not having starter c++ sooner!
So when we start out our program we need to declare all of the libraries we will be using.
think of libraries like a group of many tools for c++ that are made to be utilized by the user, without any libraries, displaying simple text on the screen would be VERY difficult.
right now, though, the only library we will use is call iostream
iostream just creates the stream of input and output from the console window
#include <iostream>
using namespace std;
namespace std; just makes it so that you dont need to add std:: before everything.
now we need to create out function
Functions are basically blocks of code that can be called at any time.
the function we will use in main(), which is automatically called upon by the computer.
int main() {
//code here
return 0;
}
the code will be inserted between the curly brackets (when you put //, that line becomes a comment and will not be read by the compiler.)
you put int befor main because it declares that the return will be an integer, you might want to look up what a return is, but it doesnt matter much now.
Finally, we will finish by adding
cout << "Hello World" <<endl;
inside the curly brackets of main() to finish it all up.
this code just prints out "Hello World" to the console (without quotes), and "endl" just makes it so the line ends afther the "Hello World".
Ok so please Follow for more tutorials, and like and share this with others via google+ or facebook or twitter or whatever social networking site you use!
Thanks for reading!!!
and today we will be beginning c++!
C++ is probably the most powerful programming language out there, and is constantly updated!
Some of the uses of c++ are
- Video games
- Commercial applications, for math or even analytics
- Mobile applications
- microcontrollers such as the arduino
- and much much more
*WARNING c++ is not simple, but with some practice, you can make so many on your computer that you will regret not having starter c++ sooner!
So when we start out our program we need to declare all of the libraries we will be using.
think of libraries like a group of many tools for c++ that are made to be utilized by the user, without any libraries, displaying simple text on the screen would be VERY difficult.
right now, though, the only library we will use is call iostream
iostream just creates the stream of input and output from the console window
#include <iostream>
using namespace std;
namespace std; just makes it so that you dont need to add std:: before everything.
now we need to create out function
Functions are basically blocks of code that can be called at any time.
the function we will use in main(), which is automatically called upon by the computer.
int main() {
//code here
return 0;
}
the code will be inserted between the curly brackets (when you put //, that line becomes a comment and will not be read by the compiler.)
you put int befor main because it declares that the return will be an integer, you might want to look up what a return is, but it doesnt matter much now.
Finally, we will finish by adding
cout << "Hello World" <<endl;
inside the curly brackets of main() to finish it all up.
this code just prints out "Hello World" to the console (without quotes), and "endl" just makes it so the line ends afther the "Hello World".
Ok so please Follow for more tutorials, and like and share this with others via google+ or facebook or twitter or whatever social networking site you use!
Thanks for reading!!!
Comments
Post a Comment