c++ 翻译成c#该如何处理
c++ 翻译成c#
哪位C++ 大侠帮忙把一下程序翻译成c#?还有就是这段程序的运行结果,如果能运行的话。
class R
{
public:
int k, depth;
R() :k(0), depth(0) {}
const R& operator=( const R & r )
{
if( this != &r )
{ k = r.k; depth = r.depth+1; }
return r;
}
};
int main()
{
R r1, r2, r3;
r1 = r2 = r3;
printf( "%d %d %d\n",
r1.depth, r2.depth, r3.depth );
}
------解决思路----------------------
我也不懂
哪位C++ 大侠帮忙把一下程序翻译成c#?还有就是这段程序的运行结果,如果能运行的话。
class R
{
public:
int k, depth;
R() :k(0), depth(0) {}
const R& operator=( const R & r )
{
if( this != &r )
{ k = r.k; depth = r.depth+1; }
return r;
}
};
int main()
{
R r1, r2, r3;
r1 = r2 = r3;
printf( "%d %d %d\n",
r1.depth, r2.depth, r3.depth );
}
------解决思路----------------------
我也不懂