摘要: int find_order(int arr[], int len, int num); int main() { // 1. 新建数组 int arr[] = {5, 2, 0, 3, 33, 4, 44}; int num = 4; int len = sizeof(arr) / sizeof( 阅读全文
posted @ 2026-10-22 14:10 Coca-code 阅读(2) 评论(0) 推荐(0)
摘要: int main() { // 1. 打开文件 printf("文件操作 —— 写入\n"); FILE *file = fopen("//Users//usr//Desktop//a.txt", "w"); // 2. 写出数据 // fputc, 一次一个字符,返回这个字符串 int c = f 阅读全文
posted @ 2026-10-18 23:42 Coca-code 阅读(2) 评论(0) 推荐(0)
摘要: int main() { // 1. 打开文件 printf("文件操作 —— 多字节\n"); char arr[1024]; // 开的buffer int n; // 读取到到数 FILE *file = fopen("//Users//test.txt", "r"); // 2. 读取多个字 阅读全文
posted @ 2026-10-11 10:32 Coca-code 阅读(5) 评论(0) 推荐(0)
摘要: /* 2. 文件操作,读,行 */ int main() { // 1. 打开文件 printf("文件操作 —— 整行\n"); char arr[1024]; char *str; FILE *file = fopen("//Users//test.txt", "r"); // 2. 读取文件并 阅读全文
posted @ 2026-10-10 23:40 Coca-code 阅读(4) 评论(0) 推荐(0)
摘要: /* 1. 文件操作,读,字符 2. */ int main() { // 1. 打开文件 printf("文件操作 —— 字符\n"); int c; FILE *file = fopen("//Users//xxxxx//Desktop//test.txt", "r"); // 2. 读取文件并 阅读全文
posted @ 2026-10-08 12:03 Coca-code 阅读(7) 评论(0) 推荐(0)
摘要: int main() { // 1. 输入字符串 printf("\n 请输入字符串 \n"); char arr_str[100]; scanf("%s", arr_str); printf("输入的字符串是:%s\n", arr_str); char *p = arr_str; // 遍历字符串 阅读全文
posted @ 2026-10-07 17:00 Coca-code 阅读(5) 评论(0) 推荐(0)
摘要: void method1(); int method2(int num1, int num2); int main() { void (*p)() = method1; int (*pp)(int, int) = method2; // 第一个执政函数运行 p() p(); // 第二个指针函数运行 阅读全文
posted @ 2026-10-07 15:25 Coca-code 阅读(2) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> // void forEachArrFn(int arr[], int len); // int _max(int arr[], int len); // int contains( 阅读全文
posted @ 2026-10-06 09:31 Coca-code 阅读(5) 评论(0) 推荐(0)
摘要: /*1. Function point array format*/ int *fnArr[n] (int)(int) = {fn1,fn2,fn3...}; /* 2. Struct & array */ int main() { // 1. 定义struct模板 struct stuObj { 阅读全文
posted @ 2026-10-02 21:08 Coca-code 阅读(4) 评论(0) 推荐(0)
摘要: int printfArr(int arr[], int len); int main() { // 定义 int arr[4] = {0}; int len = sizeof(arr) / sizeof(arr[0]); int i = 0; int j = len - 1; printf(" 请 阅读全文
posted @ 2026-09-30 13:02 Coca-code 阅读(5) 评论(0) 推荐(0)