摘要:
1.#include <stdio.h>#include <malloc.h>int main(){ int i = 0; int* pI = (int*)malloc(5 * sizeof(int)); short* pS = (short*)calloc(5, sizeof(short)); f 阅读全文
摘要:
1.#include <stdio.h>typedef int(FUNC)(int);int test(int i){ return i * i;}void f(){ printf("Call f()...\n");}int main(){ FUNC* pt = test; void(*pf)() 阅读全文
摘要:
1.#include <stdio.h>void access(int a[][3], int row){ int col = sizeof(*a) / sizeof(int); int i = 0; int j = 0; printf("sizeof(a) = %d\n", sizeof(a)); 阅读全文
摘要:
1.#include <stdio.h>int main(int argc, char* argv[], char* env[]){ int a[3][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}}; int i = 0; int j = 0; for(i=0; i<3 阅读全文
摘要:
1.#include <stdio.h>typedef int(AINT5)[5];typedef float(AFLOAT10)[10];typedef char(ACHAR9)[9];int main(){ AINT5 a1; float fArray[10]; AFLOAT10* pf = & 阅读全文
摘要:
1.#include <stdio.h>#include <assert.h>size_t strlen(const char* s){ return ( assert(s), (*s ? (strlen(s+1) + 1) : 0) );}int main(){ printf("%d\n", st 阅读全文
摘要:
1.#include <stdio.h>int main(){ int a[5] = {1, 2, 3, 4, 5}; int* p1 = (int*)(&a + 1); int* p2 = (int*)((int)a + 1); int* p3 = (int*)(a + 1); printf("% 阅读全文
摘要:
1. #include <stdio.h>// another file// char* p = "Hello World!";extern char p[];int main(){ printf("%s\n", p); return 0;} 说明: 数组是一片连续的内存空间数组的地址和数组首元素 阅读全文
摘要:
1. #include <stdio.h>int main(){ int i = 5; int* p = &i; printf("%d, %08X\n", i, p); *p = 10; printf("%d, %08X\n", i, p); return 0;} 说明: const int* p; 阅读全文
摘要:
1.希尔算法: #include <stdio.h>/* 希尔排序算法实现--但有时不稳定 */void println(int array[], int len){ int i = 0; for(i=0; i<len; i++) { printf("%d ", array[i]); } print 阅读全文