| | |
Adding datas of two files in C
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
open first input file A
open output file
read input file A (probably use fgets() )
write to output file (using fprintf() or fputs() )
close input file A
open input file B
repeat the above for B
close both files and you are done
You need to study your textbook about the functions fopen(), fgets(), fprintf(), fputs(), and fclose(). You also need to know about character arrays that hold the information in memory that the fgets() function uses.
open output file
read input file A (probably use fgets() )
write to output file (using fprintf() or fputs() )
close input file A
open input file B
repeat the above for B
close both files and you are done

You need to study your textbook about the functions fopen(), fgets(), fprintf(), fputs(), and fclose(). You also need to know about character arrays that hold the information in memory that the fgets() function uses.
Last edited by Ancient Dragon; Jun 19th, 2009 at 12:26 am.
![]() |
Similar Threads
- deleting files from arraylist (Java)
- Adaware won't remove VX2 nasty (Viruses, Spyware and other Nasties)
- Think I have big problems with spyware (Viruses, Spyware and other Nasties)
- About;Blank Please Help, Hijack Log File (Viruses, Spyware and other Nasties)
- Hello, im in dire need of help. (Viruses, Spyware and other Nasties)
- Hijacked! Log attached - please help! (Viruses, Spyware and other Nasties)
- cannot burn discs (Apple Hardware)
Other Threads in the C Forum
- Previous Thread: Reading Problem in C
- Next Thread: recursive palindrome
| Thread Tools | Search this Thread |
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string strings suggestions systemcall test testautomation unix urboc user voidmain() wab win32api windows.h






