[英] goto

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

问题描述



我知道我知道这很糟糕!我不想用它。我在想,

它还存在吗?如果确实如此,我真的不明白怎么做!?喜欢什么

如果你只是转到一个函数的中途(没有正确的对象构建!)或构造函数本身?或者
只是好奇!!


迈克

Hi,
I know I know its notoriously bad! I don''t want to use it. I was wondering,
does it still exist? If it does, I really don''t understand how!? like what
happens if you just goto halfway through a function (no objects properly
constructed!) , or a constructor itself??
Just intrigued!!

Mike

推荐答案

*迈克尔:


是的。


如果确实如此,我真的不明白怎么做!?


像往常一样。


喜欢什么如果你只是在功能中途转到(没有正确的对象)
构建!),


§6.6.4/ 3禁止;它不会或不应该编译。


或构造函数本身?





只是好奇!!

I know I know its notoriously bad! I don''t want to use it. I was wondering,
does it still exist?
Yes.

If it does, I really don''t understand how!?
Like always.

like what
happens if you just goto halfway through a function (no objects properly
constructed!) ,
That is forbidden by §6.6.4/3; it won''t or shouldn''t compile.

or a constructor itself??
?

Just intrigued!!




当你了解更多你在所有语言中都会发现更多不安全的结构。


-

答:因为它弄乱了人们通常阅读文本的顺序。

问:为什么这么糟糕?

A:热门发布。

问:usenet上最烦人的事情是什么并在电子邮件中?



As you learn more you''ll find many more unsafe constructs, in all languages.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


迈克尔写道:
Michael wrote:
我知道我知道这很糟糕!


长期功能不好。短的没有理由使用''goto'',因此

''goto''相对无害。

我不想用它。我在想,它还存在吗?如果确实如此,我真的不明白怎么做!?喜欢什么
如果你只是转到一个函数的中途(没有正确构造的对象!),或构造函数本身?
I know I know its notoriously bad!
Long functions are bad. Short ones have no reason to use ''goto'', and thus
''goto'' is relatively harmless.
I don''t want to use it. I was wondering,
does it still exist? If it does, I really don''t understand how!? like what
happens if you just goto halfway through a function (no objects properly
constructed!) , or a constructor itself??




通常,不应该通过但我的编译器喜欢它来学习C ++定律。


在这种情况下,一个小小的VC ++实验很有用:


goto bar;

string foo;

bar:;


错误C2362:''foo''的初始化是跳过''goto bar''


语言设计师负责处理它。由于没有传统的C构造函数支持
,他们的编程器拒绝(相对)非结构化的''goto''

滥用。


-

Phlip
http://industrialxp.org/community/bi...UserInterfaces




" Alf P. Steinbach" ; <人*** @ start.no>在消息中写道

news:42 **************** @ news.individual.net ...

"Alf P. Steinbach" <al***@start.no> wrote in message
news:42****************@news.individual.net...
*迈克尔:

我知道我知道这很糟糕!我不想用它。我是b $ b想知道,它还存在吗?


I know I know its notoriously bad! I don''t want to use it. I was wondering, does it still exist?
Yes.

如果确实如此,我真的不明白怎么做!?
If it does, I really don''t understand how!?



像往常一样。



Like always.

喜欢什么如果你只是在功能中途转到(没有对象正确<构造!),
like what
happens if you just goto halfway through a function (no objects properly
constructed!) ,



§6.6.4/ 3禁止这样做;它不会或不应该编译。



That is forbidden by §6.6.4/3; it won''t or shouldn''t compile.



那么你可以''转到''''的限制是什么?

本地范围?


so what are the limits on what you can ''goto'' ''to'' ?
local scope?

或构造函数本身?


or a constructor itself??
?

只是好奇!!



当你了解更多时,你会发现更多不安全的结构,所有



As you learn more you''ll find many more unsafe constructs, in all



语言。
-
答:因为它弄乱了人们通常阅读文字的顺序。
问:为什么这是一件坏事?
答:热门帖子。
问:什么usenet和电子邮件中最烦人的事情是什么?


languages.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?



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

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