I'm trying to get my code to read in a txt file, it was working yesterday but now when I run it through "start without debugging" it prints out the message I prompted it to but that's it, and no matter what I type in it re-asks the user the same question instead of printing what was written in the txt file.
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
void main ()
{
FILE *file_in;
char value;
file_in = NULL;
char unencrypted [1000];
while (file_in == NULL)
{
printf("Please enter the name of the file you want to open:\n");
scanf("%s", unencrypted);
file_in = fopen(unencrypted, "r");
}
printf("\n This file consists of the following message: \n");
while(!feof(file_in))
{
value = fgetc(file_in);
printf("%c", value);
}
fclose(file_in);
}