by "Xiutao Yang" <xiutao.yang@[EMAIL PROTECTED]
>
Apr 15, 2008 at 10:55 PM
thx,all
Now, I found the reason.
void NEW(int i){
NEWW(i);
PPR(i);
}
wil be compiled as
void NEW(int i){
CMyClass *a_##i=new CMyClass();
cout<<a_##i->m_i<<endl
}
Of course, It works well :P
thx again.
"Ben Bacarisse" <ben.usenet@[EMAIL PROTECTED]
> ??????:874pa3jqhd.fsf@[EMAIL PROTECTED]
> "Xiutao Yang" <xiutao.yang@[EMAIL PROTECTED]
> writes:
>
>> I have a program about ## ,which is the following.
> <snip>
>
>> #define F(i) F_##i()
>
> <snip more pre-processor mangling>
>
>> The question is the I can call NEWW(i) in function void NEW(int i)
>> But failed in processing function void FF(int i)?
>> If we write void FF(int i) as:
>> void FF(int i){
>> F(i);
>> }
>> It will fail.
>
> That is because FF(i) expands to F_i() and there is no F_i defined.
> Presumably in NEWW(i) the value of i does not matter. You seem to
> want the pre-processor (which runs once when you program is built) to
> know about the value of variables at run-time. It just can't.
>
> Back up a bit and explain what you are doing and why you think this is
> the right solution.
>
> --
> Ben.