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.

Did you tried with fgets? For help read this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.