谜题 [英] intrestring puzzle

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

问题描述

以下源文件无法编译。

#include< cstdio>

class X {

public:

X(){i = 100; }

私人:

int i;

};

int main()

{

X x;

printf("%d \ n",xi);

}


在X的定义中添加一行(有一个分号),在

中使得文件可编辑。 itsValue shud b private。

The following source file does not compile.
#include <cstdio>
class X {
public:
X() { i = 100; }
private:
int i;
};
int main()
{
X x;
printf("%d\n", x.i);
}

Add one line (having one semicolon) to the definition of X that in
turn makes the file compilable. itsValue shud b private.

推荐答案

* 我们********@yahoo.com (dada)schriebt:
* us********@yahoo.com (dada) schriebt:
以下源文件无法编译。
添加一行(有一个分号)到在
转向中的X的定义使文件可编辑。它的价值是私人的。
The following source file does not compile.
Add one line (having one semicolon) to the definition of X that in
turn makes the file compilable. itsValue shud b private.




是的,它是星期五,但不要同时喝酒和发布。



Yes, it''s friday, but don''t drink and post at the same time.


2004年2月27日10:19:59 -0800,我们**** ****@yahoo.com (dada)写道:
On 27 Feb 2004 10:19:59 -0800, us********@yahoo.com (dada) wrote:
以下源文件无法编译。
#include< cstdio>
X级{
公共:
X(){i = 100; }
私人:
int i;
};
int main()
{x /; x x;
printf("%d) \ n",xi);


在X的定义中添加一行(有一个分号),在
中使文件可编辑。 itsValue shud b private。
The following source file does not compile.
#include <cstdio>
class X {
public:
X() { i = 100; }
private:
int i;
};
int main()
{
X x;
printf("%d\n", x.i);
}

Add one line (having one semicolon) to the definition of X that in
turn makes the file compilable. itsValue shud b private.




class X {

public:

X(){i = 100; }

私人:

public:int x; //添加了这个

int i;

};


问题是,我不知道你的意思是什么/>
itsValue shud b private。

这是变量的名称吗?如果是这样,它来自哪里,如果没有,

值不公开或私有,所以你在说什么?你可以用英语吗?b $ b你好吗? ;-)

-leor


Leor Zolman

BD软件
le ** @ bdsoft.com
www。 bdsoft.com - C / C ++,Java,Perl& Cn的现场培训Unix

C ++用户:下载BD Software的免费STL错误消息

Decryptor at www.bdsoft.com/tools/stlfilt.html



class X {
public:
X() { i = 100; }
private:
public: int x; // added this
int i;
};

Problem is, I have no idea what you mean by
itsValue shud b private.
Is that the name of a variable? If so, where did it come from, and if not,
values aren''t public or private, so what are you talking about? And could
you use English, please? ;-)
-leor

Leor Zolman
BD Software
le**@bdsoft.com
www.bdsoft.com -- On-Site Training in C/C++, Java, Perl & Unix
C++ users: Download BD Software''s free STL Error Message
Decryptor at www.bdsoft.com/tools/stlfilt.html


dadaescribió:
dada escribió:
在X的定义中添加一行(具有一个分号),在
中使文件可编辑。 itsValue shud b private。
Add one line (having one semicolon) to the definition of X that in
turn makes the file compilable. itsValue shud b private.




friend int main();


问候。



friend int main ();

Regards.


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

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