Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in C Programming by (120 points)

I wrote a C program in VS 2019 to read a file but got the error message "D:\C PROGRAM\TEST\test1\x64\Debug\Test1.exe (process 8072) exited with code -1073741819", So please help me out.

Here is the source code---

#include<stdio.h>

#include<stdlib.h>

int main()

{

FILE* fp;

char ch;

fp = fopen_s(&fp,"linked list C.txt", "r");

if (fp == NULL)

{

puts("\nFile can't be open");

exit(0);

}

/*Line no. before first line*/

do

{

ch = fgetc(fp);

printf("%c", ch);

}while (ch != EOF);

fclose(fp);

return 0;

}

Please log in or register to answer this question.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...