又一个挑剔的风格问题 [英] Yet another nitpicky style question

查看:85
本文介绍了又一个挑剔的风格问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您更喜欢* my_string还是my_string [0]?为什么?


-

Christopher Benson-Manica |我*应该*知道我在说什么 - 如果我

ataru(at)cyberspace.org |不,我需要知道。火焰欢迎。

Do you prefer *my_string or my_string[0]? Why?

--
Christopher Benson-Manica | I *should* know what I''m talking about - if I
ataru(at)cyberspace.org | don''t, I need to know. Flames welcome.

推荐答案



" Christopher Benson-Manica" <在*** @ nospam.cyberspace.org>在消息中写道

news:c0 ********** @ chessie.cirr.com ...

"Christopher Benson-Manica" <at***@nospam.cyberspace.org> wrote in message
news:c0**********@chessie.cirr.com...
你更喜欢* my_string还是my_string [0 ]?为什么?
Do you prefer *my_string or my_string[0]? Why?




取决于。 somestruct-> charptr [0]比

*(somestruct-> charptr)更容易阅读我觉得...


但是


* charptr ++ ='''';


更清洁


charptr [0] = ''一个''; ++ charptr;


Tom



depends. somestruct->charptr[0] is easier to read than
*(somestruct->charptr) I think...

But

*charptr++ = ''a'';

Is cleaner than

charptr[0] = ''a''; ++charptr;

Tom




" Tom St Denis" < to*@securescience.net>在消息中写道

news:qZ ************** @ news01.bloor.is.net.cable.ro gers.com ...

"Tom St Denis" <to*@securescience.net> wrote in message
news:qZ**************@news01.bloor.is.net.cable.ro gers.com...

Christopher Benson-Manica <在*** @ nospam.cyberspace.org>在消息中写道
新闻:c0 ********** @ chessie.cirr.com ...

"Christopher Benson-Manica" <at***@nospam.cyberspace.org> wrote in message
news:c0**********@chessie.cirr.com...
你更喜欢* my_string还是my_string [0]?为什么?
Do you prefer *my_string or my_string[0]? Why?



取决于。 somestruct-> charptr [0]比
*(somestruct-> charptr)更容易阅读我认为...



depends. somestruct->charptr[0] is easier to read than
*(somestruct->charptr) I think...




注意:[之前任何人都明智]我通常把()放在我的会员身边

引用只是为了明确意图。


Tom



Note: [before anyone gets wise] I normally put () around my member
references just to make the intent clear.

Tom


Tom St Denis< to*@securescience.net>写道:
Tom St Denis <to*@securescience.net> wrote:
" Tom St Denis" < to*@securescience.net>在消息中写道
新闻:qZ ************** @ news01.bloor.is.net.cable.ro gers.com ...
"Tom St Denis" <to*@securescience.net> wrote in message
news:qZ**************@news01.bloor.is.net.cable.ro gers.com...
取决于。 somestruct-> charptr [0]比
*(somestruct-> charptr)更容易阅读我认为...
depends. somestruct->charptr[0] is easier to read than
*(somestruct->charptr) I think...



注意:[之前任何人都明智了]我通常把()围绕我的成员
引用只是为了使意图明确。


Note: [before anyone gets wise] I normally put () around my member
references just to make the intent clear.




我假设那么'' - >''绑定比''''更紧密?


-

Harrison Caudill | 。^ www.hypersphere.org

计算机科学&物理双专业| |我*我= 1

佐治亚理工学院| v''我只是一个普通人



I''m assuming then that the ''->'' binds more tightly than the ''*''?

--
Harrison Caudill | .^ www.hypersphere.org
Computer Science & Physics Double Major | | Me*Me=1
Georgia Institute of Technology | v'' I''m just a normal guy


这篇关于又一个挑剔的风格问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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