So this is my first question here. If you could help me, that would be much appreciated. This code is about my thesis. I'm trying to write to a file and it works but trying to read another file is not reading. I can't make it work. "file does not open" appears on the screen. Help me please, for read to file.
#include <cstdio>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main()
{
FILE* myfile;
errno_t errorcode = fopen_s(&myfile, "output.txt", "w");
if (myfile == NULL)
{
printf("Error");
}
FILE* data;
errno_t err = fopen_s(&data, "C:\SA\input.txt", "r");
//errno_t err = fopen_s(&data, "input.txt", "r");
if(data==NULL)
{
printf("file does not open");
}
return 0;
getchar();
}