Submit Search
Upload
10401_206296_Hw11
•
Download as PPTX, PDF
•
0 likes
•
92 views
Jessica Hsieh
Follow
10401_206296_Hw11
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 6
Download now
Recommended
C語言檔案處理
C語言檔案處理
吳錫修 (ShyiShiou Wu)
La natación
La natación
morenoe4b
CoreWaysolution_Company_Profile
CoreWaysolution_Company_Profile
Coreway Business Collaborating
La tarjeta principal o mother board (1)
La tarjeta principal o mother board (1)
jesusars
Diccionario de Sociología
Diccionario de Sociología
Melissa Frois Orueta
ArchiSPEAK Assignment
ArchiSPEAK Assignment
Sebabonkhe Tebokgo Masuku
Mapas mentales de sistmas administracion de recursos empresariales
Mapas mentales de sistmas administracion de recursos empresariales
marling Guzman
Dec 2011 results
Dec 2011 results
wgjlubbe
Recommended
C語言檔案處理
C語言檔案處理
吳錫修 (ShyiShiou Wu)
La natación
La natación
morenoe4b
CoreWaysolution_Company_Profile
CoreWaysolution_Company_Profile
Coreway Business Collaborating
La tarjeta principal o mother board (1)
La tarjeta principal o mother board (1)
jesusars
Diccionario de Sociología
Diccionario de Sociología
Melissa Frois Orueta
ArchiSPEAK Assignment
ArchiSPEAK Assignment
Sebabonkhe Tebokgo Masuku
Mapas mentales de sistmas administracion de recursos empresariales
Mapas mentales de sistmas administracion de recursos empresariales
marling Guzman
Dec 2011 results
Dec 2011 results
wgjlubbe
Hw12#5
Hw12#5
Jessica Hsieh
10401_206296_Hw12
10401_206296_Hw12
Jessica Hsieh
10401_206296_Hw9
10401_206296_Hw9
Jessica Hsieh
10401_206296_Hw8
10401_206296_Hw8
Jessica Hsieh
10401_206296_Hw7
10401_206296_Hw7
Jessica Hsieh
10401_206296_Hw6
10401_206296_Hw6
Jessica Hsieh
10401_206296_Hw4&5
10401_206296_Hw4&5
Jessica Hsieh
10401_206296_Hw2
10401_206296_Hw2
Jessica Hsieh
10401_206296_Hw1
10401_206296_Hw1
Jessica Hsieh
Homework7補充教學
Homework7補充教學
Jessica Hsieh
More Related Content
More from Jessica Hsieh
Hw12#5
Hw12#5
Jessica Hsieh
10401_206296_Hw12
10401_206296_Hw12
Jessica Hsieh
10401_206296_Hw9
10401_206296_Hw9
Jessica Hsieh
10401_206296_Hw8
10401_206296_Hw8
Jessica Hsieh
10401_206296_Hw7
10401_206296_Hw7
Jessica Hsieh
10401_206296_Hw6
10401_206296_Hw6
Jessica Hsieh
10401_206296_Hw4&5
10401_206296_Hw4&5
Jessica Hsieh
10401_206296_Hw2
10401_206296_Hw2
Jessica Hsieh
10401_206296_Hw1
10401_206296_Hw1
Jessica Hsieh
Homework7補充教學
Homework7補充教學
Jessica Hsieh
More from Jessica Hsieh
(10)
Hw12#5
Hw12#5
10401_206296_Hw12
10401_206296_Hw12
10401_206296_Hw9
10401_206296_Hw9
10401_206296_Hw8
10401_206296_Hw8
10401_206296_Hw7
10401_206296_Hw7
10401_206296_Hw6
10401_206296_Hw6
10401_206296_Hw4&5
10401_206296_Hw4&5
10401_206296_Hw2
10401_206296_Hw2
10401_206296_Hw1
10401_206296_Hw1
Homework7補充教學
Homework7補充教學
10401_206296_Hw11
1.
HW11 DUE:2015/12/14 23:59
2.
Problem 01. 讀入兩個text
file(老師給的f1.txt和f2.txt) 將裡面的資料按照原子數小到大的順序排列輸出到一個binary檔中並同時顯 示在螢幕上 若兩個檔案有原子數相同的資料僅需輸出一筆 前提:同一個file裡面不會有相同的兩筆資料
3.
Problem 01. void
file_merge(FILE *in1p, FILE *in2p, FILE *outp); 需實作之函式,做資料合併的動作 int scan_element(element_t *einp); 讀取使用者輸入並存入element_t中,作業實作時用不到~ Void print_element(element_t eoutp); 在螢幕上印出一筆資料 Void fprint_element(FILE *out_file, element_t eoutp); 印一筆資料到檔案中,實作中因為我們要輸出binary data所以也用不到~ int fscan_element(FILE *fp, element_t *einp); 從檔案讀一筆資料並存進element_t中, return 1代表成功,0代表失敗,EOF代表檔案結尾
4.
Problem 01. 用flag_one和flag_two的值判斷有沒有成功讀進資料
flag_one = fscan_element(in1p, &from_one); flag_two = fscan_element(in2p, &from_one); 用from_one.anum跟from_two.anum比較原子數 寫資料進檔案用fwrite() 舉例寫from_one的資料進去: fwrite(&from_one, sizeof(element_t), 1, outp);
5.
Problem 01. 要寫的區塊有兩個(有兩個
/* fill_me */) 第一部分是兩個檔案每次抓一筆資料來比較,原子數較小的輸出,並從那一 個檔案再讀一筆新資料,直到其中一個檔案讀完跳出迴圈(理論上…) 第二部分是將還沒讀完的檔案中剩下的data逐一讀進來然後輸出
6.
輸出的檔案記得用筆記本打開來 看看,顯示亂碼才是正確的喔!!!!
Download now