您好* ++ *? [英] Hello and *++* ?

查看:70
本文介绍了您好* ++ *?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我想发布并加入这个小组。我是编程的新手(大学毕业了
c库。在花了7年的时间编写了拼凑的程序之后,我感觉要回到我的

根源并对标准c感兴趣。我从c-faq学到了很多

的金额,并期待了解更多。


我有一个问题,抱歉在第一次这样做发布。


我正在寻找一些来源,寻找最佳实践解析

命令行参数,并在ls源代码中看到这一行:
http://minnie.tuhs。 org / UnixTree / V7 / u ... / cmd / ls.c.html


while(* ++ * argv)switch(** argv)


什么是* ++ *?


-

-Zack

I guess I wanted to post and ''join'' the group. I''m new to programming (out
of college < 1 year) and most of my background is in ''c/c++''. What I''ve
come to realise is a bastardised version c++ that sometimes uses
c libraries. After spending 7 years writing programs that were cobbled
together messes of libraries and technologies I feel like going back to my
roots and have taken an interest in standard c. I learned a significant
amount from the c-faq and look forward to learning more.

I do have a question, sorry for doing that on the first post.

I was looking through some source looking for best practices parsing
command line arguments and saw this line in the ls source at:
http://minnie.tuhs.org/UnixTree/V7/u.../cmd/ls.c.html

while (*++*argv) switch (**argv)

What is the *++* ?

--
-Zack

推荐答案

2007-02-15< D8 ***************************** *@comcast.com>,

Zack写道:
2007-02-15 <D8******************************@comcast.com>,
Zack wrote:

我正在寻找一些寻找最佳实践解析的来源

命令行参数并在ls源代码中看到此行:
http://minnie.tuhs.org/UnixTree/V7/u.../cmd/ls.c .html



任何古老的东西都可能不会反映现代最好的

做法......

Anything that ancient is probably not going to reflect modern-day best
practices...


而(* ++ * argv)开关(** argv)
while (*++*argv) switch (**argv)



....我休息一下。

....I rest my case.


什么是* ++ *?
What is the *++* ?



它相当于(*(++(*(argv))))。

It''s equivalent to (*(++(*(argv)))).


2月14日晚上7点34分,Zack< e ... @ invalid.comwrote:
On Feb 14, 7:34 pm, Zack <e...@invalid.comwrote:

while(* ++ * argv)switch(** argv)


什么是* ++ *?
while (*++*argv) switch (**argv)

What is the *++* ?



我以为每个人都知道* ++ *运算符......;)


让我们写一下另一种方式:


*(++(* argv))


更好? :)


Preincrement和dereference具有相同的优先级和关联

从右到左。


- Beej

I thought everyone knew about the *++* operator... ;)

Let''s write that another way:

*(++(*argv))

Better? :)

Preincrement and dereference have the same precedence and associate
right-to-left.

-Beej


Zack写道:
Zack wrote:

我想我想发帖和''加入' ' 群组。我是编程的新手(大学毕业了
c库。在花了7年的时间编写了拼凑的程序之后,我感觉要回到我的

根源并对标准c感兴趣。我从c-faq那里学到了很多金额,并期待学到更多。
I guess I wanted to post and ''join'' the group. I''m new to programming (out
of college < 1 year) and most of my background is in ''c/c++''. What I''ve
come to realise is a bastardised version c++ that sometimes uses
c libraries. After spending 7 years writing programs that were cobbled
together messes of libraries and technologies I feel like going back to my
roots and have taken an interest in standard c. I learned a significant
amount from the c-faq and look forward to learning more.



很高兴看到你加入Zack集团,欢迎登机。


虽然该结构有效,但每个se,目前尚不清楚。你最好的选择是

首先避免这样一个古老的源代码树,而是参考更多

现代Unix操作系统来源,例如:


OpenSolaris:
http://cvs.opensolaris.org/source/xr...rc/cmd/ls/ls.c


GNU coreutils:
http://cvs.savannah.gnu.org/viewcvs/...utils&view=log

GNU glibc:
http://sources.redhat.com /cgi-bin/cv...?cvsroot=glibc


FreeBSD:
http://www.freebsd.org/cgi/cvsweb.cgi/src/bin/ls/ls .c


我你刚刚开始,找到某种类型的现代unix主机,带有一个现代编译器,并开始编写所有打开编译器警告的代码。

犯下所有常见错误并向他们学习。


不要使用Microsoft。

Good to see you''re joining the group Zack, welcome aboard.

While that construct is valid, per se, it''s not clear. Your best bet is to
avoid such an ancient source tree in the first place and instead consult more
modern Unix OS sources such as:

OpenSolaris:
http://cvs.opensolaris.org/source/xr...rc/cmd/ls/ls.c

GNU coreutils:
http://cvs.savannah.gnu.org/viewcvs/...utils&view=log

GNU glibc:
http://sources.redhat.com/cgi-bin/cv...?cvsroot=glibc

FreeBSD:
http://www.freebsd.org/cgi/cvsweb.cgi/src/bin/ls/ls.c

If you''re just starting out, find a modern unix host of some sort, with a
modern compiler, and start writing code with all compiler warnings turned on.
Make all the common mistakes and learn from them.

Don''t use Microsoft.


这篇关于您好* ++ *?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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