免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: lyreopera
打印 上一主题 下一主题

[翻译]《The New C》——几篇介绍C99特性的文章 2010年4月30日更新 [复制链接]

论坛徽章:
2
程序设计版块每日发帖之星
日期:2015-06-17 22:20:00每日论坛发贴之星
日期:2015-06-17 22:20:00
31 [报告]
发表于 2010-05-01 11:51 |只看该作者
楼上的大哥……以上的文件都可以直接编辑的

而且,google会记录改动历史的

我说一下怎么编辑吧:
...
lyreopera 发表于 2010-05-01 10:55



    您的劳动,我不好改。这是一种尊重
    我的看法,供您参考。这是一种感谢

论坛徽章:
2
程序设计版块每日发帖之星
日期:2015-06-17 22:20:00每日论坛发贴之星
日期:2015-06-17 22:20:00
32 [报告]
发表于 2010-05-01 11:56 |只看该作者
本帖最后由 pmerofc 于 2010-05-01 11:58 编辑
这些文章从去年十二月断断续续翻译到现在,我也不是专业的翻译,免不了有中间不一致的地方,这个时候就要借助社区的力量啊。

而对我来说,翻译的过程,某种程度上来说,也就是精读的过程。

以前也翻译过一些别的东西,感觉好烂。有时候会这么想,翻译得这么烂,有错的有漏的,误人子弟可不好,还是别糟蹋原文了。。。
lyreopera 发表于 2010-05-01 11:15


工作量还是很大的,而且新东西很难翻译。有错的有漏的,难免
总的来说,瑕不掩瑜。
我个人是表示衷心感谢的,希望您能理解并接受我前面表示感谢的方式——谈谈个人看法
后面几篇我也会仔细拜读并发表看法的,如果说错了什么请不要介意

论坛徽章:
0
33 [报告]
发表于 2010-05-01 12:01 |只看该作者
回复 16# numdisp
你没用过VC6,就不会知道;
我每编译2次就要kill它一次,十分钟就kill了10次

论坛徽章:
0
34 [报告]
发表于 2010-05-01 12:58 |只看该作者
工作量真的很大,感谢辛勤地劳动!

论坛徽章:
0
35 [报告]
发表于 2010-05-01 13:25 |只看该作者
回复  numdisp
你没用过VC6,就不会知道;
我每编译2次就要kill它一次,十分钟就kill了10次
zxrjkl 发表于 2010-05-01 12:01



    既然用得这么痛苦为何还要用?貌似VC6有几个service pack版本还是比较稳的。

论坛徽章:
0
36 [报告]
发表于 2010-05-01 13:30 |只看该作者
本帖最后由 numdisp 于 2010-05-01 13:38 编辑
回复  numdisp
你没用过VC6,就不会知道;
我每编译2次就要kill它一次,十分钟就kill了10次
zxrjkl 发表于 2010-05-01 12:01


俺是的确用过~~,MASM/QBASIC/TP/TC/BC++/VC4.2/BCB/VC6.0/VS2002-2005-2008一路走过来的说。Linux平台下倒只是用过 GCC 和 Intel C++。

论坛徽章:
0
37 [报告]
发表于 2010-05-01 16:22 |只看该作者
早就不用VC6
我现在是在linux上

论坛徽章:
2
程序设计版块每日发帖之星
日期:2015-06-17 22:20:00每日论坛发贴之星
日期:2015-06-17 22:20:00
38 [报告]
发表于 2010-05-01 17:06 |只看该作者
Preprocessor
Macros may take a variable number of arguments. In the macro body, the special identifier  expands into a list of the variable arguments. A macro argument may consist of no tokens. C99 has a preprocessor operator of the form: _Pragma ( string-literal ) This pragma operator behaves exactly as if a normal #pragma directive was encountered with the value of the string literal as its argument. However, the _Pragma operator may appear anywhere (not just at the beginning of a line) and macro bodies may contain _Pragma. There are additional predefined macro names indicating the version of the C Standard supported, which optional parts of the C Standard are supported, and whether the implementation is hosted or freestanding (whether there is an operating system and C library the program can call). Every function has the following implicit local variable:
static const char __func__[]
= "function-name";
where function-name is the name of the function. (Actually, __func__ does not exist unless referenced in the function.) The assert macro uses __func__ to report the function containing a failing assertion. (This is not a preprocessor feature, but it is similar to __FILE__ and __LINE__.)
Preprocessor arithmetic is performed in the largest signed and unsigned integer types the implementation supports.

arguments:一般是指实参
macro body:宏体
preprocessor operator:通常翻译为“预处理运算”
这不是处理器的特性

论坛徽章:
2
程序设计版块每日发帖之星
日期:2015-06-17 22:20:00每日论坛发贴之星
日期:2015-06-17 22:20:00
39 [报告]
发表于 2010-05-01 17:19 |只看该作者
[e] 例如:int x; sin (x) 被扩展为 sin (x)。 而float x; sin (x)则被扩展为sinf (x)。


这个例子举得不是很贴切
实际上在C99中至少有三种求正弦函数值的函数
double sin(double);
float sinf(float);
long double sinl(long double);
(此外还有以复数为实参求正弦的)
通过tgmath.h可以实现根据实参的类型选择其中一个恰当的函数

论坛徽章:
0
40 [报告]
发表于 2010-05-01 18:45 |只看该作者
回复 1# lyreopera


不错,支持
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP