- 博客(10)
- 收藏
- 关注
原创 20个Python进阶技巧
20个Python进阶技巧 本来是在查资料,无意间看到了这个知乎文章,感觉内容值得学习,但是排版实在难受,代码和注释混在一起,没有换行,同时解释也很奇怪(感觉是机翻的),当我无法忍受想关闭网页的时候,发现这篇文章是翻译自Medium的文章,但是原文章是英语写的,为了帮到那些英语不太好的Python学习者,同时方便自己之后看,于是写了这篇博文(算是笔记吧) 基于Medium的文章 《20 Py...
2020-04-13 19:47:07
5782
2
原创 函数指针的详细解释及应用
函数指针 函数指针在大型的 C 语言项目中十分重要,但是学校对它的介绍一带而过,国内一些介绍函数指针的文章十分粗浅甚至存在错误(这里就不点名了),因此博主写了这篇文章介绍函数指针,希望能够帮助一些 C 语言学习者。 文章部分内容翻译引用于 https://www.geeksforgeeks.org/function-pointer-in-c/ 函数指针的概念 类似变量,函数也会被分配一段存储空间,这段存储空间的首地址即被称做这个函数的地址。而且函数名表示的就是这个地址。既然是地址,我们就可以定义一个指针变量
2020-11-04 21:43:14
799
原创 C++二进制文件保存数据 类与结构体的区别
C++二进制文件保存数据 类与结构体的区别 运行如下测试代码: // OS: Ubuntu 19.10 // gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2) #include <iostream> #include <fstream> #include <cstdlib> #include <stri...
2020-04-18 15:23:35
1746
原创 面向小白的C语言随机数详解
面向小白的C语言随机数详解 // 生成一系列0~9之间的随机整数 #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { srand( time(NULL) ); int ret; for (int i = 0; i < 20; i++) { ...
2019-12-19 00:16:44
915
原创 C语言实现矩阵乘法
#include <stdio.h> #include <stdlib.h> int main(int argc, char const *argv[]) { int** A; int** B; int r_A; int c_A; int r_B; int c_B; printf("The row of A:"); ...
2019-11-17 21:54:46
1128
原创 PAT (Advanced Level) Practice 1001 A+B Format
PAT Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specification: Each in...
2019-11-17 21:49:27
570
原创 C语言链表操作
项目名称 Link_List 文件 head.h #ifndef LINK_LIST_HEAD_H #define LINK_LIST_HEAD_H #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> typedef enum ...
2019-11-10 16:53:47
681
原创 C语言 韩信点兵
韩信点兵 代码 #include <stdio.h> int request (int num); int main(void) { int num = 0; while ( request(num) ) { num++; } printf("%d", num); return 0; } int request (int n...
2019-09-04 22:41:43
5580
原创 C语言 打乱数组
打乱数组 代码 #include <stdio.h> #include <stdlib.h> #include <time.h> void disorganise(int a[], int len); void exchange(int* a, int* b); int main(void) { int a[] = {1,2,3,4,5,6,7,8,...
2019-09-04 15:56:32
4459
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅