一行结构初始化 [英] one line struct initialization

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

问题描述

是否有可能,如在C?我不认为是。只需检查。


Zytan

Is it possible, as in C? I don''t think it is. Just checking.

Zytan

推荐答案


>是否有可能,如在C?我不认为是。只是检查。
>Is it possible, as in C? I don''t think it is. Just checking.



如果您提供的构造函数将初始化所有成员。

Mattias


-

Mattias Sj?gren [C#MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com

请回复新闻组。

If you provide a constructor that will initialize all members.
Mattias

--
Mattias Sj?gren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


2007年3月6日20:03:39 -0800,Zytan < zy ********** @ yahoo.comwrote:
On 6 Mar 2007 20:03:39 -0800, "Zytan" <zy**********@yahoo.comwrote:

>是否有可能,如在C?我不认为是。只是检查。
>Is it possible, as in C? I don''t think it is. Just checking.



为什么不可能?你到底指的是什么?

-
http:/ /www.kynosarges.de


是否有可能,如在C?我不认为是。只是检查。
Is it possible, as in C? I don''t think it is. Just checking.

>

为什么不可能?你到底指的是什么?
>
Why wouldn''t it be possible? What exactly are you referring to?



我的意思是这样的:


int x = 4; //在一行中声明并初始化


struct abc {...};

abc = ...; //在一行中声明并初始化。这可能吗?


Zytan

I mean like so:

int x = 4; // declared and initialized in one line

struct abc { ... };
abc = ...; // declared and initialized in one line. Is this possible?

Zytan


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

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