?? ex13_03.c
字號:
/* Exercise 13.3 A macro to ouput the value of an expression */
#include <stdio.h>
/*
The macro always produces a floating-point result of evaluating the expression.
If you were to define the macro to produce an integer result, then it would only
work with expressions involing integers.
*/
#define print_value(expr) printf("\n" #expr " = %f", ((double)(expr)))
int main(void)
{
int x = 4;
double y = 3.5;
print_value(x);
print_value(y);
print_value(x*x*x - 5);
print_value(x*y+10);
print_value(x*x + x*y + y*y);
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -