Hi, I'm a newbie to programming in general and I'm really struggling with working out how on earth to do this!
I am aware of how to open the stream and read the text file using fscanf, however I want to store the text in that file into a string and I'm not sure how to configure the fscanf to do this.
So far I have:
{
FILE *file_in;
char text;
file_in=fopen("text.txt", "r");
fscanf(file_in, "...?"..... - this is the bit where I'm stuck for what to put?
fclose(file_in)
return 0;
}
I know this probably sounds really silly, but I can't quite figure out what the fscanf is actually doing, and how best to store the data.
Would it be best to store the data into an array? And how would I go about that?
This is part of a bigger program which I'm trying to write, which will then ask me to encrypt this text using a Caesar cipher. I'm thinking a string would be easier than an array?
Thanks!