When I was a freshman I heard programmers writing code and the creation of Pangu and God created the same wonderful, so I have a strong interest in programming. Later the Freshman C + + course did not give too much surprise,
instead, it is a more boring course, the teacher gave us the advice is to buy a c++primer back to see more, their own more research. This is totally different from the idea that I thought about learning in high school, and I think that we had to learn a course =80% Teacher's lessons after +20% lessons (that's how high school came along). Later on, I learned that one of the skills necessary for college to cultivate was self-study. Then I began to see C++primer:) ...
I started with the teacher's recommended Visual C + + IDE, and then I downloaded Visual Studio 2013 in sync with C++primer's tutorial. In comparison, from a beginner's perspective of 0 basis I think the latter is more convenient to use, while the former is more suitable for beginners (but I chose the latter because it looks good).
Compared to the school's C + + textbooks, I think c++primer more suitable for me as a 0 basis for beginners, it in my learning process more to achieve the guidance, let people thrillingly shoppes empowerment.
I am in a continuous learning and accept the new concept of the process, speaking of the experience of C + + learning, I think as a beginner in the process of self-study is a more important point is to see a concept, you need to know its meaning (it is best to use their own popular language to express the side to facilitate memory) , a concept similar to it, its usage (when writing code to know what it does in a program), and what the pitfalls of its details should be avoided. For example, to reference, we should know that the reference itself is not an object, it is just another name for the object (when we define the reference, the program binds the reference and its initial value together, rather than copying the initial value to the reference), the reference must be initialized (because once the initialization is complete, The reference will be bound together with its initial value object and cannot be re-bound to another object)
Eg1:int i1=100;
int &a=i1;//a point to I1 (A is the alias of I1)
int b;//Error: reference must be initialized
when it comes to references, it is necessary to think of all the complex types and the pointers that are often put together, and pointers are one of the difficulties of C + +. If you say a pointer, I will think of it is a kind of complex that points to another type. the pointer itself is an object and allows a copy to be assigned to it, and the pointer does not need to be assigned a value when defined. It is also important that the type of the pointer match exactly the object it refers to.
Eg2:double v;
Double *p1=&v;//p is a double pointer to the variable V (P1 holds the address of V)
Double *p2=p1;//The initial value is a pointer to a double object
int *p3=p1;//error: P3 type and P1 do not match;
p3=&v;//Error: The address of a double type object cannot be assigned to the int type pointer.
In Primer's after-school exercises also asked the difference between the pointer and the reference, I first wrote a few points in the book I can think of, and then combined with books, and finally on the Internet to search for similarities and differences between the basic, summarized as follows:
Similarities: Both have implemented indirect access to other objects;
Difference: 1. The pointer itself is an object; The reference is not an object but an alias to the object.
2. A reference can be initialized only at the time of definition and cannot be changed after it is defined, and the pointer may not be initialized at the time of definition, and then mutable.
3. The system allocates memory space to the pointer; The system does not allocate memory space for references (shared memory space for referenced and bound objects)
There are, of course, a lot of knowledge and difficulties with reference and pointers that I cannot describe.
In the process of learning C + +, I have a lot of sentiment
1 A lot of knowledge points are interlocking, each small details of small knowledge points may be in your future programming on the road to play a big role, pay attention to the usual small accumulation, finally to get through the "Ren du two veins."
2. Programming is mainly by self-study and strong interest and a lot of practice (previously thought programming will be the kind of teacher hand-taught ...)
3.c++ learning process is more boring, not too big achievement, every time I learn new things will want to know this is what to use, and learning JSP process but can know each string of code in the role of the page, the learning process appears more easy to understand. This gives me the experience is not easy to get started in C + +, JSP handy relatively easy. PS: People who learn C + + are generally under a great chess ...
4. Just start learning programming when not to struggle to learn what language, with what compiler, although to do, to the back you will find that all kinds of languages have common similarities between the place, if you really learn a language, mastering a language is very fast.
--------------------------Split Line-----------------------------
The code and concepts in this article are quoted from <<c++primer 5th>>
The first time to write essays, feel not very satisfied, feel a lot of nonsense, will not use the blog, typesetting is messy, to write a concrete example of the discovery, do not know my sample calculation is not an example, there are manual code word good tired!!! There is not a good place to ask teachers to teach more!
C + + Learning experience Essays