![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言基础
王廷胡_白嫖帝
这个作者很懒,什么都没留下…
展开
-
linux网络编程-TCP服务端
linux网络编程-TCP服务端代码块:#include <stdio.h>#include <sys/socket.h>#include <arpa/inet.h>#include <netinet/in.h>#include <string.h>#include <stdlib.h>#include <unistd.h>#include <signal.h>#include <pth原创 2021-03-29 10:13:06 · 277 阅读 · 1 评论 -
linux的makefil文件只针对当前单独工程文件夹
只针对当前文件夹内#Makefile 默认规则main.out:*.c gcc $^ -o $@ -lm%.o:%.c %.h gcc -c *.cclear:$@ rm -rf *.o原创 2020-07-16 21:00:07 · 111 阅读 · 0 评论 -
用指针将字符串数组位置颠倒
#include <stdio.h>#include <string.h>void show(const char* const str);char* Position_swap(char* const str);int main(int argc, char* argv[]){ char str[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; printf("Before the swap:"); show(str); Position_s原创 2020-07-11 09:58:26 · 846 阅读 · 0 评论 -
指针数组为字符串排序
#include <stdio.h>void show(char** str, int n); //打印指针数组常量字符串的内容void bubble_sort(char** str, int n, int(*func)(int, int)); //冒泡排序void quicksort(char** str, int n, int(*func)(int, int)); //快速排序int ascending_sort(char* str1, char* str2);原创 2020-07-11 09:35:35 · 1040 阅读 · 0 评论 -
关于指针的各类事项
指针“ & ” 取地址符后跟一个变量名时,&给出该变量的地址,&不能对没有地址的东西取地址。例如:&(a+b)就是错误的。指针的本质就是保存地址的变量int i;int *p = &i;普通变量的值是实际的值。指针变量的值是具有实际值的变量的地址。指正做参数时可以通过指针访问更改其变量(地址传递)。“ * ” 操作符“ * ”是一个单目运算符,用来访问指针的值所表示的地址上变量,可以做右值也可以做左值。int k = *p;*p =原创 2020-07-11 00:00:20 · 241 阅读 · 0 评论 -
C语言数据存储类型注意事项
数据存储类型1. auto自动变量,局部变量默认是自动变量;2. register寄存器变量,只是建议编译器使用寄存器,并不是一定要使用寄存器,变量类型需要CPU的支持3. extern外部变量,全局变量默认外部变量,extern的问题在于你不知道这个关键字出现的时候到底是声明还是定义。谨记:声明可多次,定义就一次。函数的声明extern关键自己是可有可无的,应为函数本身不加修饰符的话就是extern的。4. static静态变量,静态局部变量使用static修饰符定义,即使在声明时未赋原创 2020-07-10 21:14:45 · 241 阅读 · 0 评论