加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

C – 只有标量操作?

发布时间:2020-12-16 10:39:20 所属栏目:百科 来源:网络整理
导读:阅读维基百科: “The terms high-level and low-level are inherently relative. Some decades ago,the C language,and similar languages,was most often considered “high-level”,as it supported concepts such as expression evaluation,parameterise
阅读维基百科:

“The terms high-level and low-level are inherently relative. Some decades ago,the C language,and similar languages,was most often considered “high-level”,as it supported concepts such as expression evaluation,parameterised recursive functions,and data types and structures,while assembly language was considered “low-level”. Many programmers today might refer to C as low-level,as it lacks a large runtime-system (no garbage collection etc),basically supports only scalar operations,and provides direct memory addressing. It therefore readily blends with assembly language and the machine level of CPUs and microcontrollers.”

http://en.wikipedia.org/wiki/High_level_language

这究竟是什么意思?其他编程语言提供哪些操作哪些C没有?

解决方法

鉴于文章的上下文和主题,文章所指的是术语“标量”,因为它是用C语言本身定义的.在C语言中,算术类型和指针类型一起称为标量类型(见6.2.5 / 21).在日常用语中,我们经常看到这些类型被称为基本类型或内置类型(而正确的形式术语又称为标量).关键是标量类型旨在成为硬件立即(或几乎立即)支持的类型. C中的大多数非概念操作仅在标量类型和标量类型上运行.

如果你看一下C语言的历史,你会发现C的早期版本是如此限制性标量,你甚至无法将一个结构对象分配给另一个结构对象(或者将它传递给一个函数/从按值计算的功能).以后,将核心语言中的结构复制添加到C中的能力.直到今天,它仍然是整个核心语言中唯一的非标量操作.

另一方面,C以及其他更高级语言支持对用户定义类型的操作(根据定义,这些类型不是标量),或者支持其他没有硬件立即支持的类型.

附:不,这篇文章试图与矢量操作无关,而与标量操作相反.当然,对向量操作的支持与语言的级别完全正交.您可以使用低级语言以及高级语言进行向量操作.术语标量在我上面描述的意义上使用.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读