Record of key points of self-learning for the first half month

After obtaining the certificate, Hui Dao Tong started to work again. Because I changed my mentor, I have been helping with the internal test for the first month. The department director suggested that we should learn something on our own so that the next tasks will be completed and we will be busy. Use while learning. And as long as I was studying that day, I had to check in to the little boss.
Because today is more hurried, lazy, hehehe. So just simply record some of the key points learned these days.
1. First, read and write multi-language coded files.
C++ and MFC use
ifs_in.imbue(locale(".65001"));
the code number ID inside can be found on the Internet.
QT only has QTextStream stream(&file);//Text stream reading and writing, you can set the encoding
stream.setCodec("UTF-8");//Open in different encoding formats

2. Because it is also the first time to learn to use QT and MFC, I should have introduced some key APIs, but I am not familiar with it, and I don't want to do it today, so I can only add it together when I use it for a project next time. I feel like I'm going to watch the video to study and review again.

3. Some basic learning
vectors about STL can only have subscripts to read, and it is a bit tricky to use pushback when joining.
When inserting the map, there is a pair of pair<string,int> value(string("david"),5);
strMap.insert(value); I haven't noticed it before.

4. Friend class is almost the same as adding a Get and Set function to its member variables in the class.

5. Singleton: When encountered on the project, the new instructor said that he would understand it as one, and if the object of the singleton is realized, then this object is like a global variable, and there is only one in the entire program. Later, I searched my own Baidu and found that singleton turned out to be a design pattern, singleton pattern. The problem solved by this mode is that there can only be one class instance in a process. Its realization is mainly controlled globally through a variable. It turned out that the design pattern was being analyzed in detail afterwards.
6. reinterpret_cast<function type> (function pointer) (parameter); the function pointer type can be cast to a function of its function type. Generally, it is widely used in callback functions, and the function pointer is generally void* type after being obtained, and then the function type is consistent with the main frame side, and the corresponding call can be completed.

It's almost gone. In the past half month, I have passed the commonly used stl, the basic understanding of qt and mfc, and the completion of multi-language coding file reading and writing. Another thing is to get familiar with the project framework code. And started to learn the design pattern of C++. Design patterns will be described in another chapter.

Guess you like

Origin blog.csdn.net/zw1996/article/details/96729730