Cè¯è¨ä¸ä».txtææ¬æ件ä¸æè¡è¯»åå符串æ°æ®è³äºç»´æ°ç»ä¸ï¼ä»£ç å¦ä¸ï¼
#include <stdio.h>
main()
{
char s[10][20] = {0}; //å®ä¹ä¸ä¸ªäºç»´æ°ç»
int i=0;
FILE *fp; //æ件æé
fp = fopen("1.txt","r"); //读åææ¬æ件1.txt
for(i=0;i<3;i++)
{
fscanf(fp,"%s",s[i]);
printf("%s\n",s[i]); //æå°æ°æ®å°äºç»´æ°ç»ä¸
}
}
温馨提示:内容为网友见解,仅供参考