"继续]用法 [英] "Continue" usage

查看:69
本文介绍了"继续]用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以问这个小组这个有点不专注的问题......现在已经看到继续了吗?用于我工作过的一些解决方案中。 (Ex B / B $ 4 $ 4解决Tondo和Gimpel的解决方案)

是否有良好的原则可以很好地使用继续......或者... ...

任何常规/不定期贡献者都有最喜欢的

的方式特别有用。谢谢像往常一样。

May I ask the group this somewhat non-focused question....having now
seen "continue" used in some of the solutions I have worked on. ( Ex
7-4 solution by Tondo and Gimpel comes to mind)
Is there a good principle/s for the good usage of "continue"...or...do
any of the regular/irregular contributors have a "favorite" way in
which it is particularly useful. Thanks as usual.

推荐答案

mdh说:
mdh said:

请问小组这个有点不专注的问题....现在已经看到继续了用于我工作过的一些解决方案中。 (Ex B / B $ 4 $ 4解决Tondo和Gimpel的解决方案)

是否有良好的原则可以很好地使用继续......或者... ...

任何常规/不定期贡献者都有最喜欢的

的方式特别有用。谢谢你。
May I ask the group this somewhat non-focused question....having now
seen "continue" used in some of the solutions I have worked on. ( Ex
7-4 solution by Tondo and Gimpel comes to mind)
Is there a good principle/s for the good usage of "continue"...or...do
any of the regular/irregular contributors have a "favorite" way in
which it is particularly useful. Thanks as usual.



就个人而言,我更愿意保留它作为指示,否则空的

循环是空的:


for(t = s; * s!=''\''';(* s!= c)?* t ++ = * s ++:* s ++)

{

继续;

}

* t =''\ 0'';


另一个合理的观点是它应该用于快速分配

,在你不想要的循环中遇到特殊情况

对此迭代进行任何处理(但不想停止循环):


while(line_reading_function(& line,& len,fp)!= EOF)

{

skipwhite(& line);

if(line [0] ==''\ 0'')

{

继续; / *空行* /

}

if(line [0] ==''#'')

{

继续; / *评论遇到* /

}


/ *现在我们可以继续处理真实 line * /

Personally, I prefer to reserve it as an indicator that an otherwise empty
loop is intended to be empty:

for(t = s; *s != ''\0''; (*s != c) ? *t++ = *s++ : *s++)
{
continue;
}
*t = ''\0'';

Another reasonable view is that it should be used for quickly dispensing
with exceptional situations encountered in a loop where you don''t want to
do any processing on this iteration (but don''t want to stop the loop):

while(line_reading_function(&line, &len, fp) != EOF)
{
skipwhite(&line);
if(line[0] == ''\0'')
{
continue; /* empty line */
}
if(line[0] == ''#'')
{
continue; /* comment encountered */
}

/* now we can get on with processing "real" lines */


9月21日,8:39 * pm,Richard Heathfield< r ... @ see.sig.invalidwrote:
On Sep 21, 8:39*pm, Richard Heathfield <r...@see.sig.invalidwrote:

mdh说:
mdh said:

请问小组
May I ask the group



.....现在有

.....having now


见过继续使用

是否有良好的原则/ s可以很好地使用继续...或者... ...

任何常规/不正常的贡献者都有"喜爱"

的方式特别有用。 *
seen "continue" used
Is there a good principle/s for the good usage of "continue"...or...do
any of the regular/irregular contributors have a "favorite" way in
which it is particularly useful. *



就个人而言,我更愿意保留它作为指示,否则空的

循环是空的:


for(t = s; * s!=''\''';(* s!= c)?* t ++ = * s ++:* s ++)

{

*继续;}


* t =''\ 0'';


另一个合理的观点是,它应该用于快速分配

,在循环中遇到异常情况,你不想在这个迭代中进行任何处理(但是不想停止循环):


while(line_reading_function(& line,& len,fp)!= EOF)

{

* skipwhite(& line);

* if(line [0] ==''\ 0'')

* {

* *继续; / *空行* /

*}

* if(行[0] ==''#'')

* {

* *继续; / *评论遇到* /

*}


* / *现在我们可以继续处理真实 line * /

*。

*


Personally, I prefer to reserve it as an indicator that an otherwise empty
loop is intended to be empty:

for(t = s; *s != ''\0''; (*s != c) ? *t++ = *s++ : *s++)
{
* continue;}

*t = ''\0'';

Another reasonable view is that it should be used for quickly dispensing
with exceptional situations encountered in a loop where you don''t want to
do any processing on this iteration (but don''t want to stop the loop):

while(line_reading_function(&line, &len, fp) != EOF)
{
* skipwhite(&line);
* if(line[0] == ''\0'')
* {
* * continue; /* empty line */
* }
* if(line[0] == ''#'')
* {
* * continue; /* comment encountered */
* }

* /* now we can get on with processing "real" lines */
* .
*



感谢理查德的那些钩子挂起这个想法。

thanks Richard for those "hooks" to hang that idea on.


mdh写道:
mdh wrote:

>

我可以问这个小组这个有点不专心的问题......现在看到继续了吗?用于我工作的一些解决方案

on。 (Tondo和Gimpel的Ex 7-4解决方案浮现在脑海中)。

对于继续的良好使用,有一个很好的原则。或者

任何常规/不定期贡献者都有一个最喜欢的方式

,其中特别有用。谢谢你。
>
May I ask the group this somewhat non-focused question....having
now seen "continue" used in some of the solutions I have worked
on. ( Ex 7-4 solution by Tondo and Gimpel comes to mind). Is
there a good principle/s for the good usage of "continue" or do
any of the regular/irregular contributors have a "favorite" way
in which it is particularly useful. Thanks as usual.



我主要使用它来表示空语句。然而,这并不仅限于此。例如:


while((EOF!=(ch = getc(f)))&&(''\ n''!= = ch))继续;


-

[邮件]:Chuck F(cinefalconer at maineline dot net)

[page]:< http: //cbfalconer.home.att.net>

尝试下载部分。

I primarily use it to indicate an empty statement. It is not
limited to that however. For example:

while ((EOF != (ch = getc(f))) && (''\n'' != ch)) continue;

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.


这篇关于&QUOT;继续]用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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