C问题......小OT [英] C question...little OT
问题描述
我可以问一些经常困扰我的事情。
在K& R中,例如(p106),在解释他们的strcmp版本时,
指针两个字符串给出为* s和* t。
有谁知道这个约定是如何开始的。是s吗?代表
" source"例如,字符串。或者它就像s =" string"一样简单,
i =" integer"下一个字符串将是t,u,v等。
谢谢
May I ask something that has often puzzled me in C.
In K&R, for example (p106), in explaining their version of strcmp,
pointers to the two strings are given as *s and *t.
Does anyone know how this convention started. Does the "s" stand for
"source" string, for example. Or is it as simple as s="string",
i="integer" and the next string would be t, u, v, etc.
Thanks
推荐答案
mdh说:
mdh said:
我可以问一些经常困扰我的事情。
在K& R中,例如(p106),在解释中他们的strcmp版本,
指向这两个字符串的指针是* s和* t。
有谁知道这个约定是如何开始的。是s吗?代表
" source"例如,字符串。
May I ask something that has often puzzled me in C.
In K&R, for example (p106), in explaining their version of strcmp,
pointers to the two strings are given as *s and *t.
Does anyone know how this convention started. Does the "s" stand for
"source" string, for example.
我希望不是,因为那不是来源 - 它是目标!
I hope not, because that''s not the source - it''s the target!
或者它就像s =" string",
i =" integer"
Or is it as simple as s="string",
i="integer" and the next string would be t, u, v, etc.
是的,我认为这是最可能的解释。当然,当我
演示strcpy时,我使用char * u = s来保存返回值。
-
Richard Heathfield< http://www.cpax.org.uk>
电子邮件:-www。 + rjh @
谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>
Usenet是一个奇怪的放置" - dmr 1999年7月29日
Yeah, I think that''s the most likely explanation. Certainly, when I
demonstrate strcpy, I use char *u = s to hold the return value.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.......两个字符串以* s和* t给出。
....... two strings are given as *s and *t.
有谁知道这个约定是如何开始的。是s吗?代表
" source"例如,字符串。
Does anyone know how this convention started. Does the "s" stand for
"source" string, for example.
我希望不是,因为那不是来源 - 它是目标!
I hope not, because that''s not the source - it''s the target!
或者它就像s =" string",
i =" integer"下一个字符串将是t,u,v等。
Or is it as simple as s="string",
i="integer" and the next string would be t, u, v, etc.
RH写道:
RH wrote:
是的,我认为这是最可能的解释。当然,当我使用
演示strcpy时,我使用char * u = s来保存返回值。
Yeah, I think that''s the most likely explanation. Certainly, when I
demonstrate strcpy, I use char *u = s to hold the return value.
tks Richard。
tks Richard.
2007年7月4日星期三17:04:03 + 0000,Richard Heathfield死记硬背:
On Wed, 04 Jul 2007 17:04:03 +0000, Richard Heathfield rote:
> mdh说:
>mdh said:
>我可以问一下我经常在C中困惑我。
在K& R中,例如(p106),在解释他们的strcmp版本时,
两个字符串的指针给出为* s和* t。
>May I ask something that has often puzzled me in C.
In K&R, for example (p106), in explaining their version of strcmp,
pointers to the two strings are given as *s and *t.
当然,当我演示strcpy时,我使用char * u = s来保存返回值。
Certainly, when I
demonstrate strcpy, I use char *u = s to hold the return value.
也就是说,真正的大师使用一个字母的名字。
-
Roland Pibinger >
最好的软件简单,优雅,充满戏剧性 - Grady Booch
To wit, real gurus use one-letter names.
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
这篇关于C问题......小OT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!