The view of the C language

来源:互联网 发布:mac 下载 编辑:程序博客网 时间:2024/05/21 06:26

The C language was created for the specific purpose, to design the UNIX operating system. So the C language has the feature of its own history.

Now for my opinions, list some of the features of the C language: 

v     The C language is a high efficiency and portability language.

v     The C language is a powerful and flexible language.

You can manipulate the point directly. howeverif you are not carefula lot of errors will occur, especially the security issues. Now list some of the errors

1.      If you apply for a block of memory by the pointer, after you use it, you must release the memory by this pointer. Otherwise, it will lead to memory leak, and it is immoral. After the memory is released, you must set the pointer to null. Otherwise, it is likely that you will cause damage to others, that is to say that you can’t manipulate the memory that don’t belong to you.

2.      If a pointer is null, you can’t get the content that it point to. Otherwise, it will lead to a exception.

3.      You can’t return a pointer to the stack. Because the address is invalid out of the life circle of the function.

v       The C language is a process-oriented language.

However, in some situations, the C can support polymorphism. That is to use the linker smartly. What you need do is that you can only indicate the linking order. The reason is that. When the linker finds the action, the linker will not look for the action from the other object file.

 

原创粉丝点击