📜  C和嵌入式C有什么区别?

📅  最后修改于: 2021-05-26 00:15:13             🧑  作者: Mango

C语言:
C是一种通用编程语言,被广泛用于设计任何类型的基于桌面的应用程序。它是由Dennis Ritchie作为系统编程语言开发的,用于开发操作系统。 C语言的主要功能包括对内存的低级访问,一组简单的关键字以及简洁的样式,这些功能使C语言适用于诸如OS或编译器开发之类的系统编程。实际上,它使用本机平台开发方案,即由它开发应用程序是依赖于平台的,并且只能在单个平台上使用。

嵌入式C:
嵌入式C是C语言的扩展,用于开发基于微控制器的应用程序。嵌入式C语言从常规C编程语言开始的扩展是I / O硬件寻址,定点算术运算,访问地址空间等。嵌入式C程序具有五层基本结构。他们是:

  • 注释:这些是简单易读的文本,用代码编写,以使用户更容易理解。通常,注释以/// * * /编写。
  • 预处理程序指令:预处理程序指令告诉编译器查找哪些文件以查找程序中不存在的符号。
  • 全局声明:定义全局变量的代码部分。
  • 局部声明:定义局部变量的代码部分。
  • 主要函数:每个C程序都有一个驱动整个代码的主要函数。它主要有两个部分:声明部分和执行部分。其中,声明部分是声明所有变量的位置,执行部分定义程序中执行的整个结构。

实际上,它使用跨平台开发方案,即,通过它进行应用程序开发是独立于平台的,并且可以在多个平台上使用。

C和嵌入式C之间的区别:

Parameters C Embedded C
GENERAL
  • C is a general purpose programming language, which can be used to design any type of desktop based applications.
  • It is a type of high level language.
  • Embedded C is simply an extension C language and it is used to develop micro-controller based applications.
  • It is nothing but an extension of C.
DEPENDENCY
  • C language is hardware independent language.
  • C compilers are OS dependent.
  • Embedded C is fully hardware dependent language.
  • Embedded C are OS independent.
COMPILER
  • For C language, the standard compilers can be used to compile and execute the program.
  • Popular Compiler to execute a C language program are:
    • GCC (GNU Compiler collection)
    • Borland turbo C,
    • Intel C++
  • For Embedded C, a specific compilers that are able to generate particular hardware/micro-controller based output is used.
  • Popular Compiler to execute a Embedded C language program are:
    • Keil compiler
    • BiPOM ELECTRONIC
    • Green Hill software
USABILITY AND APPLICATION
  • C language has a free-format of program coding.
  • It is specifically used for desktop application.
  • Optimization is normal.
  • It is very easy to read and modify the C language.
  • Bug fixing are very easy in a C language program.
  • It supports other various programming languages during application.
  • Input can be given to the program while it is running.
  • Applications of C Program:
    • Logical programs
    • System software programs
  • Formatting depends upon the type of microprocessor that is used.
  • It is used for limited resources like RAM and ROM.
  • High level of optimization.
  • It is not easy to read and modify the Embedded C language.
  • Bug fixing is complicated in a Embedded C language program.
  • It supports only required processor of the application, and not the programming languages.
  • Only the pre-defined input can be given to the running program.
  • Applications of Embedded C Program:
    • DVD
    • TV
    • Digital camera
想要从精选的最佳视频中学习和练习问题,请查看《基础知识到高级C的C基础课程》。