随笔分类 -  C

摘要:C语言-C语言程序设计-文件操作 #include <stdio.h> #include <stdlib.h> int main() { FILE * fp; fp = fopen(".\workspace\demoRead.txt", "r"); if(fp == NULL) { printf(" 阅读全文
posted @ 2023-02-27 00:32 Theseus‘Ship 阅读(15) 评论(0) 推荐(0) 编辑
摘要:Linux-C-GetUserName code //getUserName.c #include <iostream> #include <string> using namespace std; #ifdef linux #include <unistd.h> #include <pwd.h> 阅读全文
posted @ 2021-01-08 19:52 Theseus‘Ship 阅读(213) 评论(0) 推荐(0) 编辑
摘要:Linux-C-信号未决/阻塞-BlockSig(sigset_t s) //BlockSig(SIGPIPE) void BlockSig(int sig) { sigset_t signal_mask; //设置信号集参数 sigemptyset(&signal_mask); //sigempt 阅读全文
posted @ 2021-01-08 18:10 Theseus‘Ship 阅读(129) 评论(0) 推荐(0) 编辑
摘要:#C语言-C语言程序设计-Practice code 书上第一章的几个练习。 关于直方图有点头疼,之后再仔细研究一下。 /*1-8 统计空格、制表符、换行符个数*/ int c; int nl = 0; int nt = 0; int nb = 0; while((c = getchar()) != 阅读全文
posted @ 2020-11-14 11:02 Theseus‘Ship 阅读(149) 评论(0) 推荐(0) 编辑
摘要:#C语言-C语言程序设计-Function-strcpy 书上关于strcpy介绍了数组、指针、指针简化的例子,对于代码简化是个可见的例子,记录下来。 #include <stdio.h> #include <stdlib.h> int main() { //initial value char c 阅读全文
posted @ 2020-11-14 10:56 Theseus‘Ship 阅读(106) 评论(0) 推荐(0) 编辑
摘要:#C语言-C语言程序设计-Function-fopen 直接抄的书上的,编译没过,应该和系统有关,用的windows系统去编译unix上的函数。 就功能理解上还是可以的,所以没有在去linux上重新编译。 #include <stdio.h> #include <stdlib.h> #include 阅读全文
posted @ 2020-11-14 10:48 Theseus‘Ship 阅读(115) 评论(0) 推荐(0) 编辑
摘要:#C语言-C语言程序设计-Application-逆波兰计算器 最近软考的时候才知道的逆波兰表达式,这个竟然是C的内容之一,把书上的抄下来了。 主要就是对操作数的入栈出栈,以及与操作符匹配的一种应用方式。 #include <stdio.h> #include <stdlib.h> /* 为了使用a 阅读全文
posted @ 2020-11-14 10:45 Theseus‘Ship 阅读(237) 评论(0) 推荐(0) 编辑
摘要:#C语言-C语言程序设计-Function-Find 照着书敲了一遍然后又重新读了一次才发现程序通过while循环识别的 -xn这种输入。 #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAXLINE 1000 阅读全文
posted @ 2020-11-14 10:41 Theseus‘Ship 阅读(212) 评论(0) 推荐(0) 编辑
摘要:#希尔排序-C语言 2020.11月软考时考了希尔排序,但是目前我还是没想明白他的那个if要填什么。。。。。 下面是今天重新看的 《C程序设计语言》书上的例子,这个和之前理解的希尔就没有什么出入了。 void shellSort(int v[], int n){ int gap, i, j, tem 阅读全文
posted @ 2020-11-11 20:17 Theseus‘Ship 阅读(178) 评论(0) 推荐(0) 编辑
摘要:#C-长度修饰符 July 11, 2020 7:43 AM hh与d, i, o, u, x, X, or n配合使用,表示对应一个signed char或unsigned char数据。 h与d, i, o, u, x, X, or n配合使用,表示对应一个short int或unsigned 阅读全文
posted @ 2020-07-11 07:44 Theseus‘Ship 阅读(188) 评论(0) 推荐(0) 编辑
摘要:#Code-Linux-time_t https://www.runoob.com/w3cnote/cpp-time_t.html 概念 Unix时间戳(Unix timestamp),或称Unix时间(Unix time)、POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威 阅读全文
posted @ 2020-07-10 22:58 Theseus‘Ship 阅读(172) 评论(0) 推荐(0) 编辑
摘要:JSON的简单介绍以及C语言的JSON库使用 JSON概述 JSON: JavaScript 对象表示法( JavaScript Object Notation) 。是一种轻量级的数据交换格式。 它基于ECMAScript的一个子集。 JSON采用完全独立于语言的文本格式, 但是也使用了类似于C语言 阅读全文
posted @ 2020-07-10 02:13 Theseus‘Ship 阅读(870) 评论(0) 推荐(0) 编辑
摘要:Linux-C-信号&信号量 July 10, 2020 12:49 AM signal(SIGHUP, SIG_IGN); signal(SIGHUP, SIG_IGN); signal信号函数,第一个参数表示需要处理的信号值(SIGHUP),第二个参数为处理函数或者是一个表示,这里,SIG_IG 阅读全文
posted @ 2020-07-10 00:53 Theseus‘Ship 阅读(1214) 评论(0) 推荐(0) 编辑

Live2D
欢迎阅读『C』
点击右上角即可分享
微信分享提示