标签:style blog http color io 2014 div log
三种定义常量的方法
1 #include <stdio.h> 2 3 //1. 预编译 4 #define PI 3.14 5 6 int main(void) 7 { 8 //2. const关键字 9 const int LENGTH = 100; 10 11 //3. 枚举类型 12 enum color { 13 RED, 14 GREEN, 15 BLUE 16 }; 17 printf("pi = %f\n", PI); 18 printf("length = %d\n", LENGTH); 19 printf("red = %d\n", RED); 20 printf("green = %d\n", GREEN); 21 printf("blue = %d\n", BLUE); 22 }
标签:style blog http color io 2014 div log
原文地址:http://www.cnblogs.com/itpoorman/p/3920677.html