| | |
Adding datas of two files in C
![]() |
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 |
#include * adobe ansi api array asterisks binarysearch centimeter changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc csyntax database directory dynamic execv feet fgets file fork function getlasterror getlogicaldrivestrin givemetehcodez global grade gtkgcurlcompiling gtkwinlinux hacking hardware highest histogram ide include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue number odf opendocumentformat opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing segmentationfault sequential single socket socketprograming standard string systemcall threads turboc unix user voidmain() wab whythiscodecausesegmentationfault windows.h windowsapi






