上一页 1 ··· 6 7 8 9 10 11 12 13 下一页
摘要: 字符串存入数组 文本内容: line1_1 line1_2line2_1 line2_2line3_1 line3_2line4_1 line4_2line5_1 line5_2line6_1 line6_2 C代码: 1 #include <stdlib.h> 2 #include <stdio. 阅读全文
posted @ 2020-11-03 15:43 un-define 阅读(2063) 评论(0) 推荐(0)
摘要: 1 static char *revers(char *s) 2 { 3 int len=strlen(s); 4 char *s2=(char *)malloc(sizeof(char)*(len+1)); 5 for(int i=len-1; i>=0; i--) 6 { 7 switch (s 阅读全文
posted @ 2020-10-28 11:22 un-define 阅读(423) 评论(0) 推荐(0)
摘要: 利用getdelim函数分割读取字段,将文件制表符替换为空格符 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main(int argc, char *argv[]) 5 { 6 char *line = NULL; 7 FILE *fp; 8 阅读全文
posted @ 2020-10-19 10:08 un-define 阅读(1301) 评论(0) 推荐(0)
摘要: 指向指针数组的指针。 1 #include <stdio.h> 2 3 int main(void) 4 { 5 char *pa[4]={"aaaaa","bbbbb","ccccc","ddddd"}; // 类型: char* (*)[4] 6 7 char** p=pa; // 指针p指向一 阅读全文
posted @ 2020-10-08 16:27 un-define 阅读(170) 评论(0) 推荐(0)
摘要: C语言一级指针指向一级指针 和二级指针指向一级指针的区别! 1 #include <stdio.h> 2 #include <string.h> 3 4 int main(void) 5 { 6 char s1[]="hello"; 7 char *p = s1; 8 char *q = p; 9 阅读全文
posted @ 2020-09-30 18:02 un-define 阅读(118) 评论(0) 推荐(0)
摘要: 很简陋,没有做输入校验,以写出来为第一目的,中间出了不少问题,尤其是结构体内字符串赋值的时候(理解不透彻😔),字符串比较用strcmp不能直接==判定,逻辑也很重要,不然会出现莫名其妙的问题。 涉及知识:结构体 数组 字符串 1 #include <stdlib.h> 2 #include <st 阅读全文
posted @ 2020-09-30 15:04 un-define 阅读(151) 评论(0) 推荐(0)
摘要: 字符串指针和字符串数组使用区别 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 5 int main(void) 6 { 7 char str1[]="this is str1!"; 8 puts(str1); 9 阅读全文
posted @ 2020-09-29 23:39 un-define 阅读(493) 评论(0) 推荐(0)
摘要: perl : while(defined(my $f1=<FQ1>) && defined(my $f2=<FQ2>)){ condition } python3 : for line1,line2 in zip(fileHandle1,fileHandle2): condition 阅读全文
posted @ 2020-09-28 16:54 un-define 阅读(142) 评论(0) 推荐(0)
摘要: do while 循环小练习 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main(void) 5 { 6 int a; 7 do{ 8 fprintf(stdout,"%s\n","请输入一个整数:"); 9 scanf("%d",&a); 阅读全文
posted @ 2020-09-22 19:32 un-define 阅读(213) 评论(0) 推荐(0)
摘要: 改进了一下,利用zlib可以读取gz格式的压缩文件,也可以直接计算非压缩格式 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <zlib.h> #define buff 1024 typedef unsigned 阅读全文
posted @ 2020-09-21 15:13 un-define 阅读(241) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 下一页