问题描述
您好,
我有一个类,其私有成员变量名为''int frame''。
然后我有一个构造函数将它设置为0.现在,在
构造函数中我想通过使用:frame + = 1来增加它;
我使用框架来加载图像从一个创建动画的数组。
但是,当在构造函数或任何成员声明上面的内容时,它没有正确递增。它将会增加一个但不会继续增加。
如果有人知道如何做到这一点会有很大的帮助。
谢谢
Jay
我怀疑你不理解构造函数。
然而,我不知道,因为你没有发布任何代码。请阅读这个
欢迎信息......
....然后再次发布(不道歉)并且有一些代码,所以我们可以
查看它。
我们喜欢代码。
-
Phlip
< - 不是博客!!!
发布示例!
-
Ian Collins。
Hi there,
I have a class that has the private member variable called ''int frame''.
I then have a constructor that sets it to 0. Now, inside the
constructor i want to increment it by using: frame += 1;
I am using frame to load images from an array that creates animation.
However, when declaring the above inside the constructor or any member
function for that matter, it doesnt increment properly. It will
increase by one but not continue like it should.
If anyone knows how I can do this it would help a lot.
Thanks
Jay
I suspect you don''t understand constructors.
However, I don''t know, because you didn''t post any code. Please read this
welcome message...
http://www.slack.net/~shiva/welcome.txt
....then post again (without apologies) and with a little code so we can
review it.
We like code.
--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Post an example!
--
Ian Collins.
这篇关于关于使用+ =的简单问题(抱歉在错误的组中发帖)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!