Git-即查即用
阿新 • • 發佈:2021-10-28
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *fp;
char wordspess[50];
char translate[50]; /* 定義檔案指標*/
if( ( fp = fopen("f1.txt", "w") ) == NULL){ /* 開啟檔案 */
printf("File open error!\n");
exit(0);
}
fscanf( fp, "%s",wordspell);
fscanf( fp, "%s",translate); /* 寫檔案 */
if( fclose( fp ) ){ /* 關閉檔案 */
printf( "Can not close the file!\n" );
exit(0);
}
printf("%s\n%s",wordspell,translate);
return 0;
}
//包含標頭檔案
//單詞型別定義
typedef struct word
{
//定義一個成員,用於儲存英文單詞拼寫
//定義一個成員,用於儲存單詞中文翻譯
}word;
//定義結構體陣列,用於儲存單詞列表
//函式宣告
//主函式
int main()
{
return 0;
}
//子函式定義
//定義函式FileRead(),從文字檔案中讀取單詞列表,存入結構體陣列中
void FileRead()
{
}