[Quote=引用楼主 ajist 的回复:]
能不能帮我详细解释一下下面一段语句,谢谢
#define ASK(p) do { \
p=new Student; \
if (p==NULL){cout<<"memory faill!"<<endl; exit(-1);} \
}while(0)
[/Quote]
遇到ASK的时候就用后面的那个do ……while语句替换,至于为什么加\,msdn解释是:The formal parameters in the list are separated by commas. Each name in the list must be unique, and the list must be enclosed in parentheses. No spaces can separate identifier and the opening parenthesis. Use line concatenation — place a backslash (\) before the newline character — for long directives on multiple source lines. The scope of a formal parameter name extends to the new line that ends token-string.