c99和c11之间的区别 [英] difference between c99 and c11

查看:914
本文介绍了c99和c11之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习c。 这本书是基于C99的。我想在完成本书后将自己的知识更新为C11,或者如果存在重大差异,请更改资源。因此,我要的是一种解释或资源来更新我的知识。我只找到了此来源。但是,它似乎不包含我需要或不简洁的信息。

I am learning c, presently. The book I read is C99 based. I want to update my knowledge to C11 after finishing this book, or change resource if there is a major difference. Thus, what I ask is for is an explanation or resource to update my knowledge. I only found this source. Nevertheless, it does not seem to encompass the information I need or not concise.

预先感谢。
P.S:我想学习C11,因为我认为这是目前流行的标准。否则,请通知我。

Thanks in advance. P.S: I want to learn C11 since I think it is the prevalent standard now. If not, please inform me.

推荐答案

C11标准的良好概述:

Good overviews of C11 standard:

  • https://en.wikipedia.org/wiki/C11_(C_standard_revision)
  • http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
  • https://smartbear.com/blog/test-and-monitor/c11-a-new-c-standard-aiming-at-safer-programming/

该标准包括对C99语言和库规范的一些更改,例如:

The standard includes several changes to the C99 language and library specifications, such as:


  • 对齐规范( _Alignas 说明符, _Alignof 运算符, aligned_alloc 函数,< stdalign.h> 头文件)

  • _Noreturn 函数说明符和< stdnoreturn.h> 头文件

  • 使用 _Generic 关键字的类型通用表达式。例如,以下宏 cbrt(x)转换为 cbrtl(x) cbrt (x) cbrtf(x),具体取决于 x 的类型:

  • Alignment specification (_Alignas specifier, _Alignof operator, aligned_alloc function, <stdalign.h> header file)
  • The _Noreturn function specifier and the <stdnoreturn.h> header file
  • Type-generic expressions using the _Generic keyword. For example, the following macro cbrt(x) translates to cbrtl(x), cbrt(x) or cbrtf(x) depending on the type of x:

#define cbrt(x) _Generic((x), long double: cbrtl, \
                          default: cbrt, \
                          float: cbrtf)(x)


  • 多线程支持( _Thread_local 存储类说明符,< threads.h> 标头,包括线程创建/管理功能,互斥量,条件变量和线程特定的存储功能,以及 _Atomic 类型限定符和< stdatomic.h> 用于不间断对象访问)。

  • Multi-threading support (_Thread_local storage-class specifier, <threads.h> header including thread creation/management functions, mutex, condition variable and thread-specific storage functionality, as well as the _Atomic type qualifier and <stdatomic.h> for uninterruptible object access).

    这篇关于c99和c11之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆