C语言基础
QX大黄蜂
博客内容属个人经验杂记,如有错误,概不负责。
展开
-
malloc() free() realloc()内存使用与释放注意事项
1、头文件:#include "stdio.h" #include <stdlib.h> //内存函数相关#include <string.h> //memset() strcpy()函数相关2、内存范例:#include "stdio.h"#include <stdlib.h>#include <string.h...原创 2019-12-20 17:34:26 · 563 阅读 · 0 评论 -
c语言 字符串数组与指针字符串的区别
#include "stdio.h"int main(void){ char *str = "hello world\r\n"; //指针类型初始化字符串,只读, //"hello world\r\n"存储在常量区 char buf[] = "hello world\r\n"; //数组类型初始化字符...原创 2019-12-20 10:50:14 · 189 阅读 · 0 评论