小编Sea*_*ghn的帖子

GOTO里面使用块,对象会被处理掉吗?

我不太确定goto在一个using区块内使用.

例如:

using(stream s = new stream("blah blah blah"));
{
    //do some stuff here

    if(someCondition) goto myLabel;
}
Run Code Online (Sandbox Code Playgroud)

现在,如果someCondition是,则代码执行将继续进行myLabel,但是,对象是否会被处置?

我在这个主题上看到了一些非常好的问题,但他们都在谈论不同的事情.

.net c# .net-4.0

3
推荐指数
1
解决办法
556
查看次数

硬编码变量,令人困惑的C语法

当我遇到这段代码时,我只是经历了一些C代码.

void someFunction(Int32 someVariable)
{
    /* someVariable is hard coded to 2 */
    (void)someVariable;

    //some processing that has nothing to do with someVariable.
}
Run Code Online (Sandbox Code Playgroud)

作者在评论中的意思是什么," someVariable被硬编码为2 "?究竟发生了someVariable什么?

c porting

2
推荐指数
1
解决办法
198
查看次数

标签 统计

.net ×1

.net-4.0 ×1

c ×1

c# ×1

porting ×1