| | |
Storing file input to an array?
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2005
Posts: 20
Reputation:
Solved Threads: 0
Hello, well, as the title states, I need to take the file input and store it into a string. It seems simple enough, just setup a for loop going through the total number of characters in the file input, or just do a while !EOF loop, the part I'm not sure about is the code that actually stores the values into the string. Using scanf or fscanf leaves out blank spaces and new lines, so the printed output doesn't match the file input properly.
How do I go about this? declaring a file pointer and then setting that to fopen and the filename works fine, and printing directly from the input works as well, but I need to store the input into a string and manipulate it from there. Any and all help is as always appreciated. Thanks everyone.
How do I go about this? declaring a file pointer and then setting that to fopen and the filename works fine, and printing directly from the input works as well, but I need to store the input into a string and manipulate it from there. Any and all help is as always appreciated. Thanks everyone.
![]() |
Similar Threads
- Reading file input into an array (C++)
- Storing file data in an array? (C++)
- Inputting text file data into an array, please help! (C++)
- File input. (C++)
Other Threads in the C Forum
- Previous Thread: hi i need help
- Next Thread: Visual inheritance
| Thread Tools | Search this Thread |
#include * ansi append array arrays asterisks binarysearch calculate changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fflush fgets file fork forloop framework function getlasterror givemetehcodez grade gtkwinlinux hacking histogram inches include incrementoperators input intmain() iso kernel keyboard km license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft motherboard mqqueue number oddnumber odf opendocumentformat opensource overwrite owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket socketprograming standard string structures systemcall testing threads turboc unix user variable voidmain() wab whythiscodecausesegmentationfault windowsapi





