首页 > 其他 > 详细

类函数宏

时间:2017-09-25 16:35:29      阅读:251      评论:0      收藏:0      [点我收藏+]
/*
 ============================================================================
 Name        : kinson.c
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>

#define ok(x) x*x
#define okk(x) (x)*(x)

int main(void)
{
    int a = 2;
    int b = 3;
    int c = ok(a+b);//6+5=11
    //int c = a+b*a+b;
    int d = okk(a+b);//
    //int d = (a+b)*(a+b)
    printf("ok(a+b)= a+b*a+b=%d\n",c);
    printf("okk(a+b)= (a+b)*(a+b)=%d\n",d);//5*5=25
    return EXIT_SUCCESS;
}

 技术分享

 

类函数宏

原文:http://www.cnblogs.com/kinson/p/7592540.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!