📜  C 和目标 C 之间的区别

📅  最后修改于: 2021-09-14 02:11:36             🧑  作者: Mango

C语言是由Dennis Ritchie在 1970 年代初期为UNIX操作系统开发的。它是一种通用的过程编程语言。该语言用于开发系统应用程序以及桌面应用程序。要了解有关 C 语言的更多信息,请参阅 https://www。极客们。 org/c-编程语言/

Objective C是由Brad CoxTom Love在 1980 年代早期开发的。它是一种面向对象的通用语言,旨在为 C 编程语言提供小型谈话风格的消息传递。这种语言允许用户通过声明来定义协议,数据成员可以是公共的私有的受保护的。这种语言在 Apple 用于iOSOS X操作系统。苹果公司于 2014 年开发了 Swift 语言来取代这种语言。但是仍然有很多公司在维护用目标 C 编写的遗留应用程序。

C和Objective C的区别:

C Language Objective C
It is a procedure oriented programming language. Problems are solved step by step fashion. Objective c is an object-oriented programming language. It adds syntax and semantics that allows for an object oriented language. But it doesn’t support multiple inheritance property.
C language can be called the subset of Objective C Objective C can be called the super set of C language. It contains classes and objects in addition to C language.
The pointers used in C language are vulnerable to security attacks. The language objective C uses null pointers and hence is type safe compared to C.
It is basically a low level language that stands too close to assembly level language. Objective C is a high-level language stuffed with small talk messaging style together with C.
C language doesn’t incorporate any classes. Bjarne Stroustrup developed the C++ language with the main intent of adding object oriented features like class to the C language. Objective C is object-oriented language and incorporates classes and offers dynamic runtime.
It follows the top-down programming approach. It follows the bottom-up programming approach.
In this language big program code is divided into small pieces of code which is called functions. In this language big program code is divided into smaller codes which is called Objects and Classes.
It supports only pointers. It supports both pointers and references.
Variables should be declared at the beginning of the program. In this language variable can be declared anywhere in the program.
C language doesn’t support the exception handling. Objective C supports the exception handling which can be implement using catch and try blocks.
C doesn’t allow to define the function with default arguments. It allows to define function with default arguments.
C can not run the code of Objective C. Objective C can run the code of C language.
C provides malloc() and calloc() functions for dynamic memory allocation, and free() for memory de-allocation. Objective C provides new operator for memory allocation and delete operator for memory de-allocation.
Data is not secured in C language. Using the concept of encapsulation, security can be achieved in Objective C.
It doesn‘t have the provision of inline function. It supports the inline function.
C does not support function and operator overloading. Objective C supports the function and operator overloading.
In general it’s known as function-driven language. It’s known as object driven language.
It doesn’t supports the encapsulation, Data hiding, inheritance, polymorphism and abstraction. Encapsulation, Data hiding, inheritance, polymorphism and abstraction are the key features of the Objective C.
C language doesn’t supports the templates. Objective C supports the templates.
It’s good for embedded services. It’s good for networking, gaming etc.
想要从精选的视频和练习题中学习,请查看 C 基础到高级C 基础课程。