摘要: #include <stdio.h> int IsBigEndian() { union NUM { int a; char b; }num; num.a = 0x1234; if( num.b == 0x12 ) { return 1; } return 0; } void main(void) 阅读全文
posted @ 2021-01-10 15:36 星空下聆听 阅读(66) 评论(0) 推荐(0) 编辑
摘要: malloc函数的原型如下: void *malloc(unsigned int size);使用malloc函数分配的内存空间是在堆中,而不是栈中,所以在使用完这块内存之后一定要将其释放,释放内存空间使用的函数是free函数。例如:int *plnt; plnt = (int*)malloc(si 阅读全文
posted @ 2021-01-10 15:30 星空下聆听 阅读(787) 评论(0) 推荐(0) 编辑