随笔分类 -  《Visual C++ 入门系列教程》

摘要:C语言的字符串操作 strtok 实现字符串切割: 将字符串根据分隔符进行切割分片. #include <stdio.h> int main(int argc, char* argv[]) { char str[] = "hello,lyshark,welcome"; char *ptr; ptr 阅读全文
posted @ 2020-05-11 15:28 lyshark 阅读(7879) 评论(0) 推荐(1) 编辑
摘要:创建临时文件 #include <stdio.h> int main(int argc, char *argv[]) { FILE *temp; char c; if ((temp = tmpfile()) != NULL) { fputs("hello lyshark\n", temp); // 阅读全文
posted @ 2020-05-11 12:51 lyshark 阅读(1361) 评论(0) 推荐(0) 编辑
摘要:结构体的定义与使用: #include <stdio.h> #include <stdlib.h> struct Student { int num; char name[30]; char age; }; int main(int argc, char* argv[]) { struct Stud 阅读全文
posted @ 2020-05-10 15:07 lyshark 阅读(962) 评论(0) 推荐(1) 编辑
摘要:指针数组: #include <stdio.h> #include <stdlib.h> #include <string.h> void PrintInt() { int x = 10,y = 20,z = 30; int *Array[] = { &x, &y, &z }; // 定义数组指针 阅读全文
posted @ 2020-05-08 11:30 lyshark 阅读(651) 评论(0) 推荐(0) 编辑
摘要:(伪)冒泡排序算法: 相邻的两个元素之间,如果反序则交换数值,直到没有反序的记录为止. #include <stdio.h> void BubbleSort(int Array[], int ArraySize) { int x, y, temporary; for (x = 0; x < Arra 阅读全文
posted @ 2020-05-06 13:27 lyshark 阅读(691) 评论(0) 推荐(0) 编辑
摘要:由于内容较少,所以,不想把它放在我的本地博客中了,暂时保存在这里,代码有一部分来源于网络,比较经典的案例,同样收藏起来。 Stack 栈容器 Stack容器适配器中的数据是以LIFO的方式组织的,它是一种先进后出的数据结构,栈允许对元素进行新增,移除,获取栈顶,等操作,但栈不允许对内部元素进行遍历, 阅读全文
posted @ 2020-05-01 11:59 lyshark 阅读(904) 评论(0) 推荐(0) 编辑
摘要:实现顺序表 #include <stdio.h> #include <stdlib.h> #define MaxSize 10 int Insert_Elem(int Array[], int *len, int ins, int val) { // 首先来判断,是否是非法插入 if (*len = 阅读全文
posted @ 2019-12-04 09:57 lyshark 阅读(1425) 评论(0) 推荐(0) 编辑


8951840 | 6896846
博客园 - 开发者的网上家园

点击右上角即可分享
微信分享提示