- 博客(7)
- 收藏
- 关注
原创 C 实现库函数strstr
实现方式一 #include <stdio.h> #include <string.h> #include <assert.h> typedef unsigned int unint; const char* my_strstr(const char* p1, const char* p2) { assert(p1 && p2); //匹配到子串计数,计算来比较子串是否完全被匹配 unint count = 0; //如果子串未完全匹配,则重
2021-09-12 17:09:02
142
原创 实现C库函数 qsort
#include <stdio.h> #include <stdlib.h> #include <string.h> void Swap(char* a, char* b, int width) { int i = 0; for (i = 0; i < width; i++) { char temp = *a; *a = *b; *b = temp; a++; b++; } } void my_qsort(void* parr, in.
2021-09-09 16:38:51
97
原创 C指针相关概念
#include <stdio.h> int Add(int x, int y) { return x + y; } int main() { int a = 10; char ch = 'W'; int arr1[2] = { 0 }; int arr2[2] = { 0 }; int arr3[2] = { 0 }; //整形指针 int* pa = &a; //字符指针 char* pch = &ch; //数组指针 int (*parr1)[.
2021-09-08 17:35:12
75
原创 计算机对于float型数据类型的读取
一、读float型数据到内存 #include <stdio.h> int main() { float f = 45.125; printf("\n"); return 0; } //00 80 34 42 //分析 /* >>1. 将小数写成 (-1)^S * M * 2^E 45.104 = 45 + 0.125 45(10) ---> 101101(2) 0.125(10) ---> 0.001(2) 45.104(10) --->
2021-09-05 00:02:14
1337
原创 Window10 64位系统下配置VSCode(VSCode-win32-x64-1.59.1)的C/C++环境
一、C/C++环境准备 1.安装MinGW + cmake 1)官方MinGW下载地址:http://www.mingw-w64.org/doku.php/start - 打开官方地址,找到“MinGW-W64 GCC-8.1.0”中的“x86_64-win32-seh”点击进行下载; - 下载之后的文件名是:“x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z”; - 解压下载的内容,放到一个自己喜欢的目录...
2021-08-28 14:39:43
2033
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人