摘要: 1.#include <stdio.h>#define NAME(n) name##nint main(){ int NAME(1); int NAME(2); NAME(1) = 1; NAME(2) = 2; printf("%d\n", NAME(1)); printf("%d\n", NAM 阅读全文
posted @ 2016-12-08 18:32 王小波私人定制 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#if defined(ANDROID20) #pragma message("Compile Android SDK 2.0...") #define VERSION "Android 2.0"#elif defined(ANDROID23) #pragma 阅读全文
posted @ 2016-12-08 18:29 王小波私人定制 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#define CONST_NAME1 "CONST_NAME1"#define CONST_NAME2 "CONST_NAME2"int main(){ #ifndef COMMAND #warning Compilation will be stoped 阅读全文
posted @ 2016-12-08 18:25 王小波私人定制 阅读(510) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#define C 1int main(){ #if( C == 1 ) printf("This is first printf...\n"); #else printf("This is second printf...\n"); #endif return 阅读全文
posted @ 2016-12-08 18:20 王小波私人定制 阅读(740) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int f1(int a, int b){ #define _MIN_(a,b) ((a)<(b) ? a : b) return _MIN_(a, b);}int f2(int a, int b, int c){ return _MIN_(_MIN_(a,b), 阅读全文
posted @ 2016-12-08 18:18 王小波私人定制 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>int main(){ int i = -2; unsigned int j = 1; if( (i + j) >= 0 ) { printf("i+j>=0\n"); } else { printf("i+j<0\n"); } printf("i+j=%d\ 阅读全文
posted @ 2016-12-08 18:14 王小波私人定制 阅读(122) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ int i = 0; // int j = ++i+++i+++i; int a = 1; int b = 2; int c = a+++b; int* p = &a; printf("c=%d\n",c); b = b; return 0 阅读全文
posted @ 2016-12-08 18:11 王小波私人定制 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#define SWAP1(a,b) \{ \ int temp = a; \ a = b; \ b = temp; \}#define SWAP2(a,b) \{ \ a = a + b; \ b = a - b; \ a = a - b; \}#defin 阅读全文
posted @ 2016-12-08 18:07 王小波私人定制 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>int main(){ int i = 0; int j = 0; if( ++i > 0 || ++j > 0 ) { printf("%d\n", i); printf("%d\n", j); } return 0;} 2.#include <stdio. 阅读全文
posted @ 2016-12-08 18:05 王小波私人定制 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>int main(){ char c = " "; while( c=="\t" || c==" " || c=="\n" ) { scanf("%c", &c); } return 0;} 2.#include <stdio.h>int main(){ ch 阅读全文
posted @ 2016-12-08 18:04 王小波私人定制 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#define SWAP(a,b) \{ \ int temp = a; \ a = b; \ b = temp; \}int main(){ int a = 1; int b = 2; SWAP(a,b); printf("a=%d, b=%d\n", a, 阅读全文
posted @ 2016-12-08 18:02 王小波私人定制 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <malloc.h>typedef struct _soft_array{ int len; int array[];}SoftArray;int main(){ int i = 0; SoftArray* sa = (SoftArray*) 阅读全文
posted @ 2016-12-08 17:54 王小波私人定制 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>void func(int n){ int* p = NULL; if( n < 0 ) { goto STATUS; } p = malloc(sizeof(int) * n); STATUS: p[0] = n; }int main(){ f(1); f( 阅读全文
posted @ 2016-12-08 17:43 王小波私人定制 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>void f1(int i){ if( i < 6 ) { printf("Failed!\n"); } else if( (6 <= i) && (i <= 8) ) { printf("Good!\n"); } else { printf("Perfect 阅读全文
posted @ 2016-12-08 17:39 王小波私人定制 阅读(184) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main() { auto int i = 0; register int j = 0; static int k = 0; printf("auto %d:",i); printf("register %d:",j); printf("static %d 阅读全文
posted @ 2016-12-08 17:36 王小波私人定制 阅读(161) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ char c = 0; short s = 0; int i = 0; printf("%d, %d\n", sizeof(char), sizeof(c)); printf("%d, %d\n", sizeof(short), sizeo 阅读全文
posted @ 2016-12-08 17:31 王小波私人定制 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <stdlib.h>#include "SQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or input 阅读全文
posted @ 2016-12-08 14:51 王小波私人定制 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <stdlib.h>#include "LinkQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or in 阅读全文
posted @ 2016-12-08 14:42 王小波私人定制 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <stdlib.h>#include "SeqQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or inp 阅读全文
posted @ 2016-12-08 14:31 王小波私人定制 阅读(483) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <stdlib.h>#include "LinkQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or in 阅读全文
posted @ 2016-12-08 14:15 王小波私人定制 阅读(197) 评论(0) 推荐(0) 编辑
DON'T FORGET TO HAVE FUN