What is included in the C language? Which parts are important and which parts need to be emphasized?

Recently completed the chat room project, C language based learning stage is also considered to have come to an end, but I'm still just an introduction to the C language, like a tool, I just now understand, will use it, but did not achieve For example, if the arm is to be used as a weapon, we will need to further study C language in the future. Today I will talk about my personal understanding of the C language, my own understanding, and if I have any mistakes, I would like to point out that I am not very grateful. .

The first is the context of the C language. What is included in the C language, which parts are important, and which parts need to be understood? This is the two questions I often ask myself.

First of all, what are the things in C language? The things in C language are not too many:

1, some of the most basic data types and their memory size, there are some basic computer knowledge (such as conversion). These things are easier after having a certain understanding of the C language.

2, three kinds of logic (order, selection and loop)

Sequential statements are statements that are not judged from top to bottom and are one step at a time.

The select statement is the if and switch statements. In a particular case, the use of the switch statement makes the program look simple and clear, especially when there are many options. Most of the time the if statement is used a bit more.

The loop statements are while, do...while, and for statements. These three do...while I don't use too many and I don't comment. There are many occasions for the while statement and the for statement. Let me talk about a few points:

a. In the multi-layered cycle, keep the longest cycle as far as possible and save the cpu resources.

b, can not modify the cycle variables in the circulation body to prevent the cycle from losing control.

c. The loop is as short as possible. Too many lines of loop code can greatly affect reading. Workaround: Use subfunctions to handle

d. The loop nesting is controlled within 3 layers, more than three layers, and the difficulty of understanding the code is greatly increased.

The control expression of the e, for statement can not contain any floating-point type of object

There are break and continue statements. Frequently, someone will ask me what the two keywords are. Break is to jump out of the closest loop (the switch is out of the switch, not out of the loop), and continue is the same.

3, arrays and pointers array I divided it into two: ordinary arrays and strings, which is the operation of the string is the C language assessment of the most critical step, because it involves an array and pointers, the string operation is very For cattle people, their understanding of pointers must be deep.

Ordinary arrays: The content of a one-dimensional array is not too many, but the requirements for the algorithm are relatively high, the most basic is that it must bubble and select the sort, these two algorithms are the most basic, but also the most used in the sort ( If there is a better algorithm to talk about), if you are interested, you can study the algorithm in depth (I haven't had time to study the algorithm and I don't know much about it). For two-dimensional arrays, to understand the memory allocation and the storage order of elements, input and output will be performed on two-dimensional arrays. Others are algorithms, and they will be slowly studied later.

String: String This part of the string, because the C language is not as easy to manipulate the string as C + +, so the pointer and array next piece of work. The simplest is to use string.h in the strlen, strcmp, strcpy, strcat, and strncmp functions.

Pointer: When the teacher talked about the pointer, he said, if you learn the pointer, you will have 70% of the C language. I was still a bit skeptical at the beginning. Now I very much agree with this sentence. Pointer is the essence of C language, C language is a soft and hard-going language, in the final analysis is the knowledge of this pointer, he can directly manipulate the bottom. Regarding the pointer, I was most impressed by that example. *p imagined p as the number of the Xiaoming family, and * was a master key. *p represented the value of Xiaoming himself. You could give Xiaoming's address to others. Other people can see Xiaoming himself by holding *(Master Key) and p(Xiao Ming House). You can operate Xiaoming himself. This example gave me a very deep impression at that time. After that, I felt that my understanding of pointers was clearly clear. I was very grateful to my C language enlightenment teacher. With his leadership, I could have a deeper understanding of C language.

4, the function of the function I feel is an extension of the main function, but it is repeatable call, you can write some complicated steps inside a function, so that the main function does not seem too bloated. The most important function is its format, return value + function name + (parameter) + function body, one of which is easy to overlook is that when the parameter is a pointer, at the beginning of the function, the entry parameters The check is to judge whether the pointer is empty or it is easy to have a segmentation error. Another is that if a function is below the main function, it's best to make a statement. Although the current compiler has omitted this step for us, we still have to develop good habits. After all, if you give an old version The compiler will complain. Compiler optimization is not the reason we are lazy. However, we can also write the function above the main function so that we do not need to consider this problem. In this part of the function, I still have many deficiencies in some places, such as recursive functions and callback functions, recursive functions involve some algorithms, I still do not know enough about the algorithm, so. . . There is not much contact with the callback function, so far it has come into contact with a SQLite3_exec function in the sqlite3 function as the third parameter of the function name.

5, keywords

The scope of the Static global variable is limited to the source file and cannot be used by other files in the source file

Local variables are confined to specific functions, out of scope is not released, there is still a function after the end of the function

The scope of the function is limited to the source file and cannot be used by other files of the source file. The function name is not visible in other files.

The const keyword in fact only needs to remember a poem on the line, “Getting near the water to get the first month”, the one closest to const can't be changed.

The extern keyword is generally used in the .h header file to declare a function, not in this file.

Struct structure, containing a variety of data types of variables, often used in data structures, such as: linked lists, stacks, queues, etc.

The enum enumeration is similar to the define function. The enumeration and the macro are very similar: the macro replaces the name with the corresponding value in the preprocessing phase. The enumeration replaces the name with the corresponding value in the compiling phase.

The union is similar to the structure of the structure, but the members of the structure occupy different memory and have no influence on each other. All members of the union occupy the same memory, and modifying one member affects all other members. Used to test the size of the system side.

To this end, the content of the C language is almost the same, in addition to some other bits and pieces of knowledge. But I learned LinuxC, so I also learned the management of Linux processes and threads, as well as the operation of files and the programming of Linux networks. The programming of Linux network --- The server that sets up tcp agreement is actually the tcp_net_socket.c in the first two articles of these few routines have been put together already. The file operation, Linux system provides a file descriptor mechanism, open after the file descriptor read and write, and C language is the fopen function, returns a pointer, the principle is similar, but the C language provides the fopen series function Can cross-platform operation. In fact, threads and processes have little content (possibly because of the shallowness of learning), and too complex content does not come into contact. One thing to mention in the thread is that of synchronization and mutual exclusion. In fact, it is also very easy to understand. For example, a door stipulates that only one person can enter a person. At this time, there are 10 people. If there is no order, if there is no order, it is mutual exclusion. If they line up according to certain rules, it is synchronized. Synchronization is a special kind of mutual exclusion.

TB BOX

Qiuck deatail:

  • Synchronization mechanism for multi-screen playing
  • Powerful processing capability
  • Comprehensive control plans
  • Synchronous and asynchronous dual-mode
  • Dual-Wi-Fi mode


Other Hardware Features

  • 4 Ethernet ports, loading capacity of each port up to 2,300,000 pixels, with the maximum width of 4096 pixels and maximum height of 1920 pixels
  • Wired Gigabit Ethernet
  • Stereo audio output
  • HDMI Loop
  • HDMI input and auto full-screen display
  • 2 USB ports allowing for USB playback
  • Onboard light sensor connector allowing for automatic and scheduled brightness adjustment

Application:
* Business Organizations:
Supermarket, large-scale shopping malls, star-rated hotels, travel agencies
* Financial Organizations:
Banks, insurance companies, post offices, hospital, schools
* Public Places:
Subway, airports, stations, parks, exhibition halls, stadiums, museums, commercial buildings, meeting rooms
* Entertainments:

Movie theaters, clubs, stages.





Video processor;controller;video controller

Guangzhou Chengwen Photoelectric Technology co.,ltd , https://www.cwleddisplay.com