由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - What's wrong with this?
相关主题
Perl里面$,@,#等字符问题求教一个perl问题
简单的perl问题问个matlab的表达式
请看看这个Perl random sampling code 有什么问题,问个 Matlab: Matrix dimensions must agree
how to initialize associate data in STL map包子求助matlab编程问题
a vba question. please helpscalar compiler error on annotation
a question of perlPerl 6 改动很大很恶心
perl question: can I have a key of hash to be有个关于stack address的问题
help for Shell script commands难道是用perl太多的结果
相关话题的讨论汇总
话题: addr话题: what话题: wrong话题: int话题: myaddr
进入Programming版参与讨论
1 (共1页)
x**********g
发帖数: 1
1
//definition
class addr_t {
public:
addr_t& operator=(const int& inlAddr) {
addr = inlAddr;
return *this;
}
//.....
public:
int addr;
}
//use it
int myaddr= 0x0001;
addr_t temp = myaddr;
//end of the code
the compiler complained " conversion from int to non-scalar type addr_t
requested.."
Anything wrong here? thanx
c*r
发帖数: 278
2
You need copy constuctor for addr_t, since you want to do initialization.

【在 x**********g 的大作中提到】
: //definition
: class addr_t {
: public:
: addr_t& operator=(const int& inlAddr) {
: addr = inlAddr;
: return *this;
: }
: //.....
: public:
: int addr;

1 (共1页)
进入Programming版参与讨论
相关主题
难道是用perl太多的结果a vba question. please help
how to count the times a function is useda question of perl
请教一道C语言的题目perl question: can I have a key of hash to be
C++ questionshelp for Shell script commands
Perl里面$,@,#等字符问题求教一个perl问题
简单的perl问题问个matlab的表达式
请看看这个Perl random sampling code 有什么问题,问个 Matlab: Matrix dimensions must agree
how to initialize associate data in STL map包子求助matlab编程问题
相关话题的讨论汇总
话题: addr话题: what话题: wrong话题: int话题: myaddr