avatar
h*l
1
md,找茬太明显了
我念说初始化一个整数为零,在定义的时候直接后面圆括号写零
这个鸟人非说我写的是方括号。。。。。说我定义的零长度数组
白板写个括号, 我还能写错不成,况且我还念给你听了
另外返回指针, 我错误情况下直接返回 零, 这个鸟人非说 一定要用 NULL
说返回零跟返回 数字一 是一样的
还tmd 是个lead,问我懂不懂 c++, 你tmd连零能当指针返回都不知道,还问我懂不懂
我花了10分钟给解释,他跟没听懂一下
西雅图某老牌大公司,顺利把我剧了
avatar
i*0
2
lolhaha的母公司?
avatar
h*l
3
不是网上购物那个
另一个

【在 i***0 的大作中提到】
: lolhaha的母公司?
avatar
L*e
4
用0代替NULL是不好的,至少逻辑上说不通。有的编译器就定义NULL为(void*)0
avatar
p*2
5

嗯。

【在 L********e 的大作中提到】
: 用0代替NULL是不好的,至少逻辑上说不通。有的编译器就定义NULL为(void*)0
avatar
j*x
6
用0没什么问题
Bs的原话
Should I use NULL or 0?
In C++, the definition of NULL is 0, so there is only an aesthetic
difference. I prefer to avoid macros, so I use 0. Another problem with NULL
is that people sometimes mistakenly believe that it is different from 0 and/
or not an integer. In pre-standard code, NULL was/is sometimes defined to
something unsuitable and therefore had/has to be avoided. That's less common
these days.
If you have to name the null pointer, call it nullptr; that's what it's
going to be called in C++0x. Then, "nullptr" will be a keyword.
avatar
s*f
7
写int i = 0; 很难么?
NULL可读性强,google建议;但c++之父建议0. 但没谁规定NULL一定要= 0.

不懂

【在 h**********l 的大作中提到】
: md,找茬太明显了
: 我念说初始化一个整数为零,在定义的时候直接后面圆括号写零
: 这个鸟人非说我写的是方括号。。。。。说我定义的零长度数组
: 白板写个括号, 我还能写错不成,况且我还念给你听了
: 另外返回指针, 我错误情况下直接返回 零, 这个鸟人非说 一定要用 NULL
: 说返回零跟返回 数字一 是一样的
: 还tmd 是个lead,问我懂不懂 c++, 你tmd连零能当指针返回都不知道,还问我懂不懂
: 我花了10分钟给解释,他跟没听懂一下
: 西雅图某老牌大公司,顺利把我剧了

avatar
A*l
8
呵呵,C/C++里面NULL还能等于什么?不管是0还是(void *)0或者其他形式,最后的
内存里的值都是0,虽然可能类型不同会被编译器抱怨

【在 s*******f 的大作中提到】
: 写int i = 0; 很难么?
: NULL可读性强,google建议;但c++之父建议0. 但没谁规定NULL一定要= 0.
:
: 不懂

avatar
y*i
9
不会因为这个被拒吧,莫非楼主拍桌子了?
avatar
S*I
10
NULL当然必须是0了。标准里要求
NULL expands to an implementation-defined null pointer constant,
同时又规定
An integer constant expression with the value 0, or such an expression cast
to type void *, is called a null pointer constant.

【在 s*******f 的大作中提到】
: 写int i = 0; 很难么?
: NULL可读性强,google建议;但c++之父建议0. 但没谁规定NULL一定要= 0.
:
: 不懂

avatar
s*f
11
只怕万一有个编译器 0 == (void *)0 不成立。

cast

【在 S**I 的大作中提到】
: NULL当然必须是0了。标准里要求
: NULL expands to an implementation-defined null pointer constant,
: 同时又规定
: An integer constant expression with the value 0, or such an expression cast
: to type void *, is called a null pointer constant.

avatar
h*l
12
不是难不难问题。我又没错
说我书法问题有意思吗
o是人作者推荐的。我那么用也不错

【在 s*******f 的大作中提到】
: 写int i = 0; 很难么?
: NULL可读性强,google建议;但c++之父建议0. 但没谁规定NULL一定要= 0.
:
: 不懂

avatar
h*l
13
我忍住没拍它
但其他没啥
它跟张绍刚一样左态度。从头就看不出尊重

【在 y******i 的大作中提到】
: 不会因为这个被拒吧,莫非楼主拍桌子了?
avatar
h*l
14
人家不是说不好。它认为用O是错误

【在 L********e 的大作中提到】
: 用0代替NULL是不好的,至少逻辑上说不通。有的编译器就定义NULL为(void*)0
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。