带参数宏定义的几种形式
摘要:
1、#define SQ(y) (y)*(y)#include<iostream.h>void main(){ int a,sq; cout<<"input a number:"; cin>>a; sq=SQ(a+1); cout<<"sq="<<sq<<endl;}当输入一个2时,可以看到结果:2、#define SQ(y) y*y#include<iostream.h>void main(){ int a,sq; cout<<"input a n 阅读全文
posted @ 2012-02-28 21:56 duancanmeng 阅读(374) 评论(0) 推荐(0) 编辑