hey guys, i dont get why i cant find a .txt file it so frustrating because i dont get why it cant find the file. i have tried it in all folders of the project and it just wont find it.
im using c btw
copy of the code:
im using c btw
copy of the code:
Code:
{
char ch, ch2;
FILE *fp1, *fp2;
fp1=fopen("MyEncryptedFileA.txt","r");
if (fp1 == NULL)
{
printf("ERROR no file\n");
ch = getchar();
exit(1);
}
printf("File Decrypted.... \n");
fp2=fopen("MyDecryptedFileA.txt","w");
ch = fgetc(fp1);
while(ch != EOF)
{
/* decryption algorithm a here */
ch2 = ch - 10;
/* end of decryption algorithm */
fprintf(fp2, "%c", ch2);
ch = fgetc(fp1);
}
fclose(fp1);
fclose(fp2);
printf("\n**********************\n");
printf("\n\n");
}
Last edited by a moderator: