define的用法??
我定义了宏
#define a 2,1
class CBit
{
CBit( int bit);
CBit( int axis,int act);
}
class CIO
{
get_in(CBit &BIT);
}
当
CIO in;
in.get_in(CBit(a));
为什么 a这里调用的 是 CBit( int bit)??
什么原因导致如此???
如果直接 in.get_in(CBit(2,1))又没问题??
求解!!!!!!!!!!
[解决办法]
http://codepad.org/TRsUpS3P
你的代码是别的问题。
[解决办法]
我这边测试调用的是双参数的那个
[解决办法]
我这边调用的也是双参数那个
[解决办法]
Test.cpp
#include "Test.h"
CBit::CBit(int bit)
{
}
CBit::CBit( int axis,int act)
{
}
CBit::~CBit(void)
{
}
void CIO::get_in(CBit &BIT)
{
}
#pragma once
#define a 2,1
class CBit
{
public:
~CBit(void);
CBit( int bit);
CBit( int axis,int act);
};
class CIO
{
public:
void get_in(CBit &BIT);
};
CIO in;
in.get_in(CBit(a));