Let's learn C++: Lec02 What is that meaning of the program(Hello World)?
Before learning C++ detail, I would like to give you a whole abstraction at first.
For learning syntax, you would know, actually, it is like a "spell" in Harry Potter.
You need to combine several correct words to instruct your computer how to achieve what you want in that program.
ex.
#include<iostream>
using namespace std;
int main(){
cout<<"Hello World";
}
cout<<"Hello World"; →it is an instruction to print out "Hello World" on command line, and this cout is stored in a namespace std to let you use, but also included in a library <iostream>.
Now, you have some jobs, if you do not have any idea about what is "namespace and library", I suggest you can google it.
As what I said, you need to learn these instruction in a program at first, and then you just start to throw the "spell" to do a magic.
For me, if let me explain "namespace and library" briefly here,
library: Briefly, library stored many tools to help you complete your program.
There are several libraries, included Standard library. As you see<iostream>, every thing about input and output, you might find some useful "tool" in this library.
namespace: it is a space to stored a classified instructions. Normally these instructions in this space are to use for same purpose. As mentioned, std means standard, and you can not only cout but also cin ... in this space to let you use.
Besides, you also see main() function in the program. It is a main place to execute those instructions you want to do.
Here, I want to tell I won't tell you more about the detail of syntax in C++ program, because there are many lectures on website and youtube channel.
Besides, I already organize 15 chapters on my github:
You really do not need to spend so much money and time on that.
In my opinion, the best way to learn is:
1. See those codes directly, and try to know what is the meaning of those codes?
2. Know what is the goal which this program to introduce you
I write the program name on every program, you can just google the name to know the concepts of C++
3. Yeah, google those you do not know and go to see these description on that website
Here, my suggestive reference:
1.https://www.w3schools.com/cpp/
2.https://www.tutorialspoint.com/cplusplus/index.htm
3.https://www.geeksforgeeks.org/cpp-tutorial/
4. how to use these code, no worry~just copy and paste to execute it directly
If it can not be executed, just google the reason as well
why just copy and paste? it doesn't sounds a good behavior for a good student.
For learning a programming language, the most important is not to remember those syntax and words quickly. The purpose and meaning of it is just the most important.
5.Follow my chapters, to capture the whole basic structure of C++ program gradually.
I won't teach you how to memorize those syntax, library and instructions name.
For those detail, there have been many website to tell you those meaning.
As for my following article about C++, I want to give some main ideas to help you become a good C++ programmer. Not just for dealing with a school homework. It is for a real work.
Remember!!
No doubt, program is just a combination of instructions to tell computer to do what thing in a continuously or non-continuously certain order.
Program itself and one of instructions is not important, what is most important is what you achieve or what problem you solve with these programs.
In other word, learning those words and syntax is just a basic task you need to do for programming at first.
For learning syntax, you would know, actually, it is like a "spell" in Harry Potter.
You need to combine several correct words to instruct your computer how to achieve what you want in that program.
ex.
#include<iostream>
using namespace std;
int main(){
cout<<"Hello World";
}
cout<<"Hello World"; →it is an instruction to print out "Hello World" on command line, and this cout is stored in a namespace std to let you use, but also included in a library <iostream>.
Now, you have some jobs, if you do not have any idea about what is "namespace and library", I suggest you can google it.
As what I said, you need to learn these instruction in a program at first, and then you just start to throw the "spell" to do a magic.
For me, if let me explain "namespace and library" briefly here,
library: Briefly, library stored many tools to help you complete your program.
There are several libraries, included Standard library. As you see<iostream>, every thing about input and output, you might find some useful "tool" in this library.
namespace: it is a space to stored a classified instructions. Normally these instructions in this space are to use for same purpose. As mentioned, std means standard, and you can not only cout but also cin ... in this space to let you use.
Besides, you also see main() function in the program. It is a main place to execute those instructions you want to do.
Here, I want to tell I won't tell you more about the detail of syntax in C++ program, because there are many lectures on website and youtube channel.
Besides, I already organize 15 chapters on my github:
Cplus_Introduction
For me, I really do not think you should spend many hours on classes in a semester to learn: the concept of variables, if-else, loop,array, pointer, function , class and etc.You really do not need to spend so much money and time on that.
In my opinion, the best way to learn is:
1. See those codes directly, and try to know what is the meaning of those codes?
2. Know what is the goal which this program to introduce you
I write the program name on every program, you can just google the name to know the concepts of C++
3. Yeah, google those you do not know and go to see these description on that website
Here, my suggestive reference:
1.https://www.w3schools.com/cpp/
2.https://www.tutorialspoint.com/cplusplus/index.htm
3.https://www.geeksforgeeks.org/cpp-tutorial/
4. how to use these code, no worry~just copy and paste to execute it directly
If it can not be executed, just google the reason as well
why just copy and paste? it doesn't sounds a good behavior for a good student.
For learning a programming language, the most important is not to remember those syntax and words quickly. The purpose and meaning of it is just the most important.
5.Follow my chapters, to capture the whole basic structure of C++ program gradually.
I won't teach you how to memorize those syntax, library and instructions name.
For those detail, there have been many website to tell you those meaning.
As for my following article about C++, I want to give some main ideas to help you become a good C++ programmer. Not just for dealing with a school homework. It is for a real work.
Remember!!
No doubt, program is just a combination of instructions to tell computer to do what thing in a continuously or non-continuously certain order.
Program itself and one of instructions is not important, what is most important is what you achieve or what problem you solve with these programs.
In other word, learning those words and syntax is just a basic task you need to do for programming at first.
留言
張貼留言