<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[DearLord的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/DearLord</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; DearLord]]></copyright><item><title><![CDATA[修改表名、字段名以及添加约束]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/104771092</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/104771092</guid><author>DearLord</author><pubDate>Tue, 10 Mar 2020 16:34:30 +0800</pubDate><description><![CDATA[修改表名
ALTER table old_name rename to new_name
例：
ALTER table users rename to qq_name;
修改字段名
ALTER table table_name
CHANGE old_name new_name type
例：
ALTER table games
change gno game_id varchar(20);
修改字...]]></description><category></category></item><item><title><![CDATA[数据库——添加约束]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/104766464</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/104766464</guid><author>DearLord</author><pubDate>Tue, 10 Mar 2020 08:32:47 +0800</pubDate><description><![CDATA[创建库
create database BASENAME;
例:create database USERS;
进入库
use basename;
例：
use users;
创建表
create table tablename(
a1 type [not null],
a2 type [not null]
)
例：
create table USERS(
user_qq varchar(20) n...]]></description><category></category></item><item><title><![CDATA[进程|信号]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/103056348</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/103056348</guid><author>DearLord</author><pubDate>Wed, 13 Nov 2019 20:10:06 +0800</pubDate><description><![CDATA[/*
当僵尸进程产生的时候，我们有两种方法可以来处理僵尸进程
1：使用kill -9 + pid 来杀死父进程
kill -9 工作原理为：向父进程发送一个进程结束信号，当父进程接收到这个信号之后，他会暂时停止正在处理的工作，转而处理信号，这个信号又恰巧是结束进程的信号，所以父进程就直接结束了
2：既然信号的工作方式是会暂停手上工作，有限处理信号的话，那么我们考虑不要向父进程发送结束进程的信号，我...]]></description><category></category></item><item><title><![CDATA[线程之间的同步|线程锁|线程的创建、取消]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/103056285</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/103056285</guid><author>DearLord</author><pubDate>Wed, 13 Nov 2019 20:07:34 +0800</pubDate><description><![CDATA[/*
通过线程之间互相聊天这个练习，我们可以知道，在一个多线程并发的进程当中，到底是哪一个线程在运行，我们是没有办法控制的。
那么，我了能够控制线程之间的运行关系，我们在多线程编程的时候，对所有的线程做同步处理。
什么叫同步处理：也就是说，当一个线程不满足逻辑运行条件的时候，我们就应该让这个线程处于阻塞状态，以便不会影响到选择其他线程的时候的运行效果
在聊天这个功能当中，我们使用了大量的标志位来确...]]></description><category></category></item><item><title><![CDATA[服务器搭建|共享内存删除共享内存]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/103056207</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/103056207</guid><author>DearLord</author><pubDate>Wed, 13 Nov 2019 20:01:41 +0800</pubDate><description><![CDATA[/*
在两个进程之间的通讯，我们使用管道，在网络之中，两个进程之间的通讯，我们使用套接字(socket)
1：服务器的搭建过程
① 创建一个套接字，使用函数socket()
函数名：socket()
头文件：sys/types.h , sys/socket.h
函数参数：int domain , int type , int protocol
这3个参数正好代表了套接字的3个属性，分别为：域，类型...]]></description><category></category></item><item><title><![CDATA[系统io,write read,重定向open,lseek(SEEK_SET,SEEKCUR,SEEKEND)]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102941776</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102941776</guid><author>DearLord</author><pubDate>Wed, 06 Nov 2019 19:50:29 +0800</pubDate><description><![CDATA[/*
区别与c语言中的文件IO：只能向普通文件内进行输入和输出，lsd中的文件io，他可以向任何类型的文件进行输入和输出操作。
由于linux中万物皆文件，包括运行中的两个程序也是两个文件，我们就可以通过lsd中的文件io向运行中的两个程序写入信息来达到数据通讯的效果。
/
/
lsd中文件io的一组函数 : read 和 write
函数名: write
头文件：sys/type.h,unist...]]></description><category></category></item><item><title><![CDATA[开奖代码]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102919559</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102919559</guid><author>DearLord</author><pubDate>Tue, 05 Nov 2019 17:20:27 +0800</pubDate><description><![CDATA[#include&lt;stdio.h&gt;
#include&lt;unistd.h&gt;
#include&lt;stdlib.h&gt;
#include&lt;time.h&gt;
#include&lt;termios.h&gt;
#include&lt;assert.h&gt;
#include&lt;string.h&gt;
#include&lt;syspes.h&gt;
#i...]]></description><category></category></item><item><title><![CDATA[使用fgets 和 fputs实现shell指令中cp文件复制]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102673494</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102673494</guid><author>DearLord</author><pubDate>Mon, 21 Oct 2019 22:26:11 +0800</pubDate><description><![CDATA[/*
使用fgets和fputs实现shell指令中cp的文件复制到文件的功能
分析：fgets源文件的内容，然后通过fputs输出到目标文件
所以应该是“r”的形式打开源文件，“w”的形式打开目标文件
现在最大的问题在于：源文件的文件名应该怎么写？目标文件的文件名怎么写
所以现在问题就转换成了：如何将终端上输入的字符创，导入到程序中作为文件名使用
利用主函数的参数 argv实现
要求2：判断目标...]]></description><category></category></item><item><title><![CDATA[文件IO]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102657649</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102657649</guid><author>DearLord</author><pubDate>Mon, 21 Oct 2019 16:33:43 +0800</pubDate><description><![CDATA[1 /*
2     文件IO:
3     文件特性：运行快，断电数据丢失
4     我们考虑在程序结束前文件数据由内存写入硬盘，下次程序运行时数据由硬盘写入
内存
5
6     三组函数：
7     ① fprintf和fscanf
8     fprintf将数据输出到文件，
9     fscanf从文件读取数据
10
11     函数名：fprintf
12     函数参数：F...]]></description><category></category></item><item><title><![CDATA[calloc,malloc,realloc]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102623639</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102623639</guid><author>DearLord</author><pubDate>Fri, 18 Oct 2019 13:14:36 +0800</pubDate><description><![CDATA[函数名：calloc
函数参数：int num,int size
函数返回值：void ptr
函数功能：在堆空间上申请num个模块的内存空间，每个模块size大小，并且将申请出来的内存空间初始化为0.
认为规定申请单个数据用malloc，申请数组使用calloc。
realloc:为指定的堆空间重新分配大小
realloc:参数：void ptr,int size
致命缺点：会带碎片容易段错误
...]]></description><category></category></item><item><title><![CDATA[结构体增、删、改、查]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102604266</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102604266</guid><author>DearLord</author><pubDate>Thu, 17 Oct 2019 12:27:18 +0800</pubDate><description><![CDATA[#include&lt;stdio.h&gt;
#include&lt;string.h&gt;
#include&lt;user.h&gt;
typedef struct Score{
int chinese;
int math;
int english;
}score_t;
typedef struct Student{
char name[20];
int id;
score_t score...]]></description><category></category></item><item><title><![CDATA[结构体 || 联合体]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102579117</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102579117</guid><author>DearLord</author><pubDate>Wed, 16 Oct 2019 12:59:36 +0800</pubDate><description><![CDATA[结构体
结构体是一个自定义的复合数据类型
例如：struct data_t;  一个代表人类的结构体，包含一下属性
struct data_t{
int height;
int weight;
int age;
char name[20];
char sex;
}data;
二分一对齐
联合体
只需把struct 改为union。
typedef union data{
}data_t;
联合体是...]]></description><category></category></item><item><title><![CDATA[字符串 注册登录系统]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102572364</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102572364</guid><author>DearLord</author><pubDate>Tue, 15 Oct 2019 18:36:26 +0800</pubDate><description><![CDATA[/*
使用字符串数组作为数据库，编写一个注册登录系统
也就是说，注册的账号和密码都是字符串，注册成功后，将他保存进入字符串数组中
注册的时候要求防重复注册
登录的时候没有额外要求，仅仅要求
① 注册好第一个账号后，能够注册第二个账号
② 没有段错误
*/
#include&lt;stdio.h&gt;
#include&lt;string.h&gt;
#include&lt;user.h&gt;
...]]></description><category></category></item><item><title><![CDATA[段错误]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102562982</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102562982</guid><author>DearLord</author><pubDate>Tue, 15 Oct 2019 13:04:26 +0800</pubDate><description><![CDATA[段错误信号：SIGSEGV
ctrl+c: SIGINT
段错误原因：
①：试图修改常量存储区的值
②：试图修改空指针地址上的值
③：试图修改野指针地址上的值
无论如何段错误的发生势必有个取值操作，否则错误不会出生

...]]></description><category></category></item><item><title><![CDATA[指针的偏移||通用指针||  通用函数输入下标想交换位置 || 带参宏传入数据类型]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102519923</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102519923</guid><author>DearLord</author><pubDate>Sat, 12 Oct 2019 17:09:00 +0800</pubDate><description><![CDATA[加法或减法
加法偏移到之后的地址，减法偏移到之前的地址。
指针的偏移和指针的取值一样全是模块化操作，对一个指针+1意味着该指针偏移到下一个模块，所以指针的偏移完全取决于该指针的基础数据类型。
void 指针
通用指针，可以指向任意类型的指针
无法直接取值
如果要对一个void指针取值的时候必须对它强制数据类型转换来确保每一个模块多大
void * 可以接任意的类型的 *
比如：void * vpa...]]></description><category></category></item><item><title><![CDATA[生成库文件||关闭终端显示与缓冲区stdin]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102495919</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102495919</guid><author>DearLord</author><pubDate>Fri, 11 Oct 2019 17:10:57 +0800</pubDate><description><![CDATA[字符串的整体输入有两个函数
①gets:直接传入字符数组
②scanf:(不读空格)
③最稳妥的字符串输入方式：fgets:
1.char * str
2.int size最多接收size字节
3.FILE* fp一个指向文件的指针
所以所有输入的内容是从fp指向的文件输入的
那么，终端作为一个文件，表述方式为stdin,stdout
fgets(str,10,stdin);
#include &...]]></description><category></category></item><item><title><![CDATA[字符数组与字符串]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102474487</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102474487</guid><author>DearLord</author><pubDate>Thu, 10 Oct 2019 13:36:25 +0800</pubDate><description><![CDATA[字符数组
char str[6] = {‘h’,‘e’,‘l’,‘l’,‘o’};
char str2[6] = “world”;
printf("%s\n",str);
scanf("%s",str2);
for(i=0;str[i]!=0;i++){
printf("%c",str[i]);
}
说明：①系统为了明确区分内存上的字符串从属关系，它会去寻找空字符，（ascii吗为0），我们称为结...]]></description><category></category></item><item><title><![CDATA[快速排序]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102463852</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102463852</guid><author>DearLord</author><pubDate>Wed, 09 Oct 2019 16:19:37 +0800</pubDate><description><![CDATA[二维数组
先声明大数组的容量，再声明小数组的容量
二维数组的遍历方式：
先遍历大数组，再遍历大数组的时候，在遍历小数组
也就是一个双层循环，外层循环遍历大数组，被嵌套的内层循环遍历小数组
快速排序
void quick_sort(int* arr,int left,int right){
if(left&gt;=right){return;}
int l = left;
int r = right...]]></description><category></category></item><item><title><![CDATA[数组]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/102385664</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/102385664</guid><author>DearLord</author><pubDate>Tue, 08 Oct 2019 14:41:23 +0800</pubDate><description><![CDATA[数组
数组：数组是一个由若干个相同数据类型的数据，相结合后而形成的数据结构
注意：数组是一种数据结构，不是一种数据类型。
数据结构和数据类型最大的区别：数据结构无法直接互相赋值以及大小的比较。只能通过特定函数（也就是算法）来实现互相赋值以及大小比较的功能。
那么数组作为一个数据结构应该如何理解：
我们应该将数组理解成一个存储相同数据类型的容器，每一个存放数据的位置都有一个唯一的下标位置，我们可以通...]]></description><category></category></item><item><title><![CDATA[内存存储区 ||可变参函数]]></title><link>https://blog.youkuaiyun.com/DearLord/article/details/101772614</link><guid>https://blog.youkuaiyun.com/DearLord/article/details/101772614</guid><author>DearLord</author><pubDate>Mon, 30 Sep 2019 17:39:23 +0800</pubDate><description><![CDATA[内存存储空间
①栈存储区  3G内存大概不到8MB，专用处理持续时间较短的变量
所有数据类型+变量名声明的局部变量都会在栈内存上申请空间
特点：自动申请，自动释放，在声明变量的同时自动为该变量申请相应的内存空间，当
生命周期结束时内核自动释放空间的使用权；先进后出
在栈空间中严禁返回一个局部变量的地址
int *func(){
int a = 5;
return &amp;a;
}//不允许这么写...]]></description><category></category></item></channel></rss>