- 博客(10)
- 收藏
- 关注
原创 5.22 2106 李文
#include <stdio.h>#include <string.h>#include <conio.h>struct fileINFO{ char filename[20]; int filelen;};char ysb[20];struct fileINFO tempname;int getfilelen(char name[]){ FILE *fp; char ch; int len=0; fp=...
2022-05-22 19:25:36 120
原创 512 李文 2106
#include <stdio.h>void main(void){char str[100]={"hello world32344"},str2[100]={"\0"};int i=0;FILE *fp;fp=fopen("1.txt","r");if(fp==NULL){printf("文件打开失败\n");return;}else{fputs(str,fp);rewind(fp);fgets(str2,100,fp);}fclose(fp);
2022-05-12 18:36:55 102
原创 李文 2106 5.11
#include <stdio.h>void main(void){ char filename[20]; char data[50]={"nice to meet you"}; char readData[50]={'\0'}; int i=0; FILE *fp; printf("请输入需要创建的文件名"); scanf("%s",filename); fp=fopen(filename,"r+"); if(fp=...
2022-05-11 19:21:15 72
原创 2106 509 李文
#include <stdio.h>#include <string.h>#include <windows.h>#define N 5typedef struct student{ char name[20]; int num; double score;}student;student number[N];student *p=number;void inputdata(void){ int i; for (...
2022-05-09 19:32:59 74
原创 李文 509 2106
#include <stdio.h>#include <string.h>#include <windows.h>#define N 5typedef struct student{ char name[20]; int num; double score;}student;student number[N];student *p=number;void inputdata(void){ int i; for (...
2022-05-09 19:09:50 155
原创 liwen 2022,4,21,
#include <stdio.h>int num[4][4];int *p[4];int (*q)[4];void outputdata(void){ int i,j; for (i=0;i<4;i++) { for(j=0;j<4;j++) { printf("%d\t",num[i][j]); } printf("\n"); }}void mai...
2022-04-21 11:32:14 35
原创 2022,4,21 指针数组 liwen
#include <stdio.h>int num[4][4];int *p[4];void pointernum(void){int i;for (i=0;i<4;i++){p[i]=num[i];}}void inputdata(void){int i,j;for (i=0;i<4;i++){for(j=0;j<4;j++){scanf("%d",*(p+i)+j);}}}void ou
2022-04-21 11:29:18 53
原创 2022,4,19 指针数 李文
#include <stdio.h>/*指针数组 本质上是一个数组变量定义 int a:数值数组 int num[5];指针变量定义 int *p;指针数组定义 int *num[5];//在指针数组中 里面的储存的内容是5个地址//二维数组 每一行都行地址num[i] 看成5个数组*/int num[5][4]={1,2,3,4,//num[0]行5,6,7,8,//num[1]行9,10,11,...
2022-04-19 11:56:28 154
原创 20220415 指针 liwen
#include <stdio.h>int num[10]={0},*p=num;void inputdata(void){ printf("请输入10个数 用空格隔开\n"); for (p=num;p<&num[10];p++) { scanf("%d",p); }}void ouputdata(void){ printf("输出数组的10个数值如下\n"); for (p=num;p<&...
2022-04-15 11:44:57 44
原创 【无标题】
#include <stdio.h>void swap1 (int p1,int p2){ int temp; temp=p1; p1=p2; p2=temp;}void main(void){ int a,b; int *pointer_1,*pointer_2; scanf("%d,%d",&a,&b); pointer_1=&a; pointer_2=&b; if(a...
2022-04-15 09:15:32 31
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人