了解节点: [英] Learning about Nodes:

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

问题描述

我已经使用C ++几年了,我一直在阅读关于节点的
。我有点困惑。我理解这背后的许多

概念,如指针和动态绑定。我的主要问题是我还没有在任何

项目中使用它们。我写的。我从我读到的关于节点的内容中写了这个。

这是我从我读到的内容中写的非常简单的程序或对象:


public:

color():rc(0),rg(0),rb(0){}

color(int r,int g,int b):rc(r),rg (g),rb(b){}

颜色(颜色,颜色);

int r()const {return rc;}

int g()const {return rg;}

int b()const {return rb;}

};


#endif


颜色::颜色(颜色c1,颜色c2){

rc = c1.r()+ c2.r()/ 2 ;

rg = c1.g()+ c2.g()/ 2;

rb = c1.b()+ c2.b()/ 2; < br $>
}


我意识到节点使用句柄和动态绑定。什么是

简单的程序,我可以写这个程序来学习如何做到这一点,并且它可以用来支持
。我在句柄方面相当弱,再一次,因为std :: libraries非常有用,所以我不会使用很多东西因为std :: libraries非常有用。

I have been using C++ for several years now and I have been reading
about nodes. I am a little confused. I understand many of the
concepts behind this such as pointers and dynamic binding. My main
problem is that I have yet to have a use for them in any of the
projects. that I write. I wrote this from what I read about nodes.
This is very simple program or object I wrote from what I read:

public:
color() : rc(0), rg(0), rb(0) {}
color(int r, int g, int b) : rc(r), rg(g), rb(b) {}
color(color, color);
int r()const {return rc;}
int g()const {return rg;}
int b()const {return rb;}
};

#endif

color::color(color c1, color c2){
rc = c1.r()+c2.r()/2;
rg = c1.g()+c2.g()/2;
rb = c1.b()+c2.b()/2;
}

I realize that that nodes use handles and dynamic binding. What is a
simple program that I can write to learn how to do this and for it to
be useful. I am pretty weak on handles, again that is somthing I don''t
use much because the std::libraries are so useful.

推荐答案



" JoeC" < en ***** @ yahoo.com写信息

news:11 ********************** @ i3g2000cwc。 googlegro ups.com ...

"JoeC" <en*****@yahoo.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...

>我已经使用C ++几年了,我一直在阅读关于节点的
。我有点困惑。我理解这背后的许多

概念,如指针和动态绑定。我的主要问题是我还没有在任何

项目中使用它们。我写的。
>I have been using C++ for several years now and I have been reading
about nodes. I am a little confused. I understand many of the
concepts behind this such as pointers and dynamic binding. My main
problem is that I have yet to have a use for them in any of the
projects. that I write.



你很可能不会。根据我的理解,节点主要用于链接列表的
。除非你对节点使用了一些不同的术语,否则
因为你所展示的代码与我所知道的节点无关。

And you most likely won''t. From my understanding, nodes are used primarily
for linked lists. Unless you are using some different term for nodes,
because the code you show has nothing to do with nodes as I know them.


我从我读到的关于节点的内容中写了这个。

这是我从我读到的内容中写的非常简单的程序或对象:


public:

color():rc(0),rg(0),rb(0){}

color(int r,int g,int b):rc(r),rg (g),rb(b){}

颜色(颜色,颜色);

int r()const {return rc;}

int g()const {return rg;}

int b()const {return rb;}

};


#endif


颜色::颜色(颜色c1,颜色c2){

rc = c1.r()+ c2.r()/ 2 ;

rg = c1.g()+ c2.g()/ 2;

rb = c1.b()+ c2.b()/ 2; < br $>
}


我意识到节点使用句柄和动态绑定。什么是

简单的程序,我可以写这个程序来学习如何做到这一点,并且它可以用来支持
。我在句柄方面相当弱,再一次,因为std :: libraries非常有用,所以我不会因为使用很多而使用了很多东西。
I wrote this from what I read about nodes.
This is very simple program or object I wrote from what I read:

public:
color() : rc(0), rg(0), rb(0) {}
color(int r, int g, int b) : rc(r), rg(g), rb(b) {}
color(color, color);
int r()const {return rc;}
int g()const {return rg;}
int b()const {return rb;}
};

#endif

color::color(color c1, color c2){
rc = c1.r()+c2.r()/2;
rg = c1.g()+c2.g()/2;
rb = c1.b()+c2.b()/2;
}

I realize that that nodes use handles and dynamic binding. What is a
simple program that I can write to learn how to do this and for it to
be useful. I am pretty weak on handles, again that is somthing I don''t
use much because the std::libraries are so useful.



JoeC写道:
JoeC wrote:

我已经使用C ++几年了,我一直在阅读

关于节点。我有点困惑。
I have been using C++ for several years now and I have been reading
about nodes. I am a little confused.



我也是。我已经使用C ++十多年了,而且我没有想法C ++节点是什么。

Me too. I''ve been using C++ for well over ten years, and I have no
idea what a C++ node is.


我明白了这背后的许多

概念如指针和动态绑定。我的主要问题是我还没有在任何

项目中使用它们。我写的。我从我读到的有关节点的内容中写到了这一点
I understand many of the
concepts behind this such as pointers and dynamic binding. My main
problem is that I have yet to have a use for them in any of the
projects. that I write. I wrote this from what I read about nodes.



再一次,节点是什么?

Again, what on earth is a node?


这是我编写的非常简单的程序或对象从我读到的内容:


public:

color():rc(0),rg(0),rb(0){}

color(int r,int g,int b):rc(r),rg(g),rb(b){}

颜色(颜色,颜色);

int r()const {return rc;}

int g()const {return rg;}

int b()const {return rb ;}

};


#endif


color :: color(color c1,color c2){

rc = c1.r()+ c2.r()/ 2;

rg = c1.g()+ c2.g()/ 2;

rb = c1.b()+ c2.b()/ 2;

}
This is very simple program or object I wrote from what I read:

public:
color() : rc(0), rg(0), rb(0) {}
color(int r, int g, int b) : rc(r), rg(g), rb(b) {}
color(color, color);
int r()const {return rc;}
int g()const {return rg;}
int b()const {return rb;}
};

#endif

color::color(color c1, color c2){
rc = c1.r()+c2.r()/2;
rg = c1.g()+c2.g()/2;
rb = c1.b()+c2.b()/2;
}



你看似乎犯了一个错误,只剪切并粘贴了部分

代码。类定义的开头在哪里?这与节点有什么关系?

You see seem to have made a mistake and only cut and pasted part of the
code. Where is the beginning of the class definition? And what does
this have to do with nodes?


我意识到节点使用句柄和动态绑定。
I realize that that nodes use handles and dynamic binding.



什么是句柄?

What is a handle?


什么是

简单程序我可以写,以了解如何做到这一点,并为它

是有用的。我在句柄方面相当弱,再一次,因为std :: libraries非常有用,所以我不会因为b $ b而使用很多东西。
What is a
simple program that I can write to learn how to do this and for it to
be useful. I am pretty weak on handles, again that is somthing I don''t
use much because the std::libraries are so useful.



什么是std :: libraries?你的意思是C ++标准库吗?

我不认为C ++标准库有节点吗?或者处理。


您是否有可能在谈论不同的语言,或某些特定于实现的



祝你好运,


Tom

What are the "std::libraries"? Do you mean the C++ standard library?
I don''t think the C++ standard library has either "nodes" or "handles."

Is it possible you''re talking about a different language, or something
that is implementation-specific?

Best regards,

Tom




JoeC写道:

JoeC wrote:

我已经使用C ++好几年了,我一直在阅读关于节点的
。我有点困惑。我理解这背后的许多

概念,如指针和动态绑定。我的主要问题是我还没有在任何

项目中使用它们。我写的。我从我读到的关于节点的内容中写了这个。

这是我从我读到的内容中写的非常简单的程序或对象:


public:

color():rc(0),rg(0),rb(0){}

color(int r,int g,int b):rc(r),rg (g),rb(b){}

颜色(颜色,颜色);

int r()const {return rc;}

int g()const {return rg;}

int b()const {return rb;}

};


#endif


颜色::颜色(颜色c1,颜色c2){

rc = c1.r()+ c2.r()/ 2 ;

rg = c1.g()+ c2.g()/ 2;

rb = c1.b()+ c2.b()/ 2; < br $>
}


我意识到节点使用句柄和动态绑定。什么是

简单的程序,我可以写这个程序来学习如何做到这一点,并且它可以用来支持
。我在句柄方面相当弱,再一次,因为std :: libraries非常有用,所以我不会因为b $ b而使用很多东西。
I have been using C++ for several years now and I have been reading
about nodes. I am a little confused. I understand many of the
concepts behind this such as pointers and dynamic binding. My main
problem is that I have yet to have a use for them in any of the
projects. that I write. I wrote this from what I read about nodes.
This is very simple program or object I wrote from what I read:

public:
color() : rc(0), rg(0), rb(0) {}
color(int r, int g, int b) : rc(r), rg(g), rb(b) {}
color(color, color);
int r()const {return rc;}
int g()const {return rg;}
int b()const {return rb;}
};

#endif

color::color(color c1, color c2){
rc = c1.r()+c2.r()/2;
rg = c1.g()+c2.g()/2;
rb = c1.b()+c2.b()/2;
}

I realize that that nodes use handles and dynamic binding. What is a
simple program that I can write to learn how to do this and for it to
be useful. I am pretty weak on handles, again that is somthing I don''t
use much because the std::libraries are so useful.



我打了一个简单的链表。我无法让它成为一个

模板。我阅读了Koening和Moo的书籍,他们将

转换成句柄,然后他们创建了一个使用

节点的程序。我想尝试构建一个使用节点的程序。我实现节点使用动态绑定。
我编写的简单程序使用了

绑定,但是从我的颜色程序中你可以使用两个对象和

创建新对象。他们用了一个例子,编译器如何做数学

的陈述。


(5 * 2)+(5 * 2),我只是因为他们是使用来自iostream的


I worte a stimple linked list. I had couldn''t realy make it a
template. I was readind the books by Koening and Moo and they went
into handles and from that they went into creating a program that used
nodes. I would like to try to build a program that uses nodes. I
realize nodes use dynamic binding. I wrote simple program that used
binding but like from my color program you can take two objects and
create new objects. They used an example how the compiler does math
statments.

(5*2) + (5*2), I just got confused because they were using things
derived from iostream.


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

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