-3
int funA(){
//this define is to do something with a,b....z
#define _MyMacro_ do{\
a....\
b,a...\
z....\
...\
}while(0);
int a;
char b;
....
float z;
....
if(condition){
_MyMacro_;
}
else if(condition2){
a++;//just change value
...//do some change to a,b,z
if(...){
_MyMacro_;
}
else{...}
}
//do something with a,b,...z
_MyMacro_;
...
}
功能我認爲這不是如果我使用功能
void subfunc(int &a,char &b,.....,float &z)
也許是更好的,使用的#define 一個很好的方式,但有很多PARAMS
的我想知道一個更好的方式來做到這一點,謝謝
這是很多......並很難看到你想要做什麼。通過'z'捕獲'a'的lambda可能會有所幫助。 – aschepler