c语言
文章平均质量分 60
simplehap
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
预处理标识符
__LINE__ 、__FILE__、__DATE__、__TIME__预定义符号解释及用法。注:一定是前后两个_。 __LINE__ //显示文件当前的行号 示例:#include #include int main() { printf("%d\n",__LINE__); system("pause"); return 0; } __FILE__//进行编译的源文件原创 2016-10-17 22:57:38 · 491 阅读 · 0 评论 -
宏和函数的区别
宏非常频繁的运用于执行简单的计算。 那么,为什么不用函数呢? 1.宏在使用时比函数在程序的规模和速度更胜一筹。 2.函数的参数必须申明为一个特定的类型,于是它只能在类型合适的表达式使用。而宏为无类型替换。 而有些情况只能用宏,就是按类型申请空间时。 如: #define MALLOC(n,type)\ ((*type)malloc ((n)*sizeof(type))); //调用原创 2016-10-18 22:07:31 · 324 阅读 · 0 评论 -
冒泡排序
#include #include #include #include void swap(int *x,int *y) { *x ^= *y; *y ^= *x; *x ^= *y; } void print_printf(int *arr,int len) { int k = 0; for(k=0; k<len; k++) { printf("%d ",arr[k])原创 2016-11-12 20:44:03 · 235 阅读 · 0 评论 -
选择排序
#include #include void my_select(int *arr,int len) { int i = 0; int j = 0; int max = 0; for(i = 0; i<len; i++) { for(j = 0; j<9-i; j++) { if(arr[max] < arr[j]) { max = j原创 2016-11-12 20:46:15 · 265 阅读 · 0 评论 -
注释转换
C语言的注释 /*C语言*/ C++的注释 //C++ 本文写的注释转换是将C语言注释转换为C++注释 大概有这几种情况 //1.一般情况 /* int i = 0; */ //2.换行问题 /* int i = 0; */ int j = 0; /* int i = 0; */ int j = 0; //3.匹配问题 /* i原创 2016-12-13 23:26:37 · 354 阅读 · 0 评论
分享