C++ 同時從2個文件讀取數據


   //FILE *stdin1;
    //FILE *stdin2;
    //freopen("D:/p/BB/11.txt", "r", stdin);
    //freopen("D:/p/BB/22.txt", "r", stdin2);
    freopen("D:/p/BB/1_2.txt", "w", stdout);
    FILE * fp1 = fopen("D:/p/BB/1.txt", "r");
    FILE * fp2 = fopen("D:/p/BB/2.txt", "r");
    
    double x, y;
    fscanf(fp1,"%lf",&x);//從輸入文件讀取一個整數
    fscanf(fp2, "%lf", &y);
    //printf("%lf  %lf \n", x, y);

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM