随笔分类 - C语言的学习
用于在C预言学习过程中使用的代码。
摘要:使用fgetc,fputc等 #include <stdio.h> #define _CRT_SECURE_NO_WARNINGS 1 int main() { //从键盘上读取一行文本信息 char buf[1024] = { 0 }; fgets(buf, 1024, stdin); fputs
阅读全文
摘要:pf=NULL:指向空,因为原空间已被销毁,指向地址,越界访问了
阅读全文
摘要:利用例题直接阐释: #define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> struct hobby//hobby:爱好 { char color[10]; char sports[10]; }; struct stu { char name[10];
阅读全文
摘要:问:实现在另一个数组中查找子字符串 #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <assert.h> #include <string.h> int main() { char* p1 = "abcdefgdef"; c
阅读全文
摘要:strcpy:字符串的拷贝,将会覆盖源字符串,遇见\0就停止。
阅读全文
摘要:问:判断数组是否是另一个数组的逆转数组(两种方法 ) #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include<string.h> #include<assert.h> void Mylift(char* left, char* ri
阅读全文
摘要:问:将字符串的n个字符左旋 例 :asdf左旋一个sdfa asdf左旋两个dfas #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include<string.h> void Ayue(char* ar, int k) { int i
阅读全文
摘要:水仙花:指一个n位数,其各位数字的n次方之和刚好等于该数本身
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <windows.h> int main() { unsigned int i; for (i = 9; i >=0; i--) { printf("%u\n", i); Sl
阅读全文
摘要:*pa :是地址值
pa :是地址
类型* 名称:是指针
阅读全文