Joined
·
3 Posts
I need to write a program to decrypt a 12 character message located in a file named “encrypted.txt†then print the decrypted message to the screen and a new file named “decryptedâ€, however I can't get the encrypted.txt file to open.
this is what I have so far:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp;
if ((fp = fopen("encrypted.txt", "r")) ==NULL)
{
printf("Input file could not be opened\
");
exit(1);
}
return 0;
}
I keep getting the fopen command to return a null, so should I create a file called encrypted? if so where? I wasn't able to find where stdio.h was located.
If anyone has any input it would be appreciated, thank you.
this is what I have so far:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp;
if ((fp = fopen("encrypted.txt", "r")) ==NULL)
{
printf("Input file could not be opened\
");
exit(1);
}
return 0;
}
I keep getting the fopen command to return a null, so should I create a file called encrypted? if so where? I wasn't able to find where stdio.h was located.
If anyone has any input it would be appreciated, thank you.