I see that some related questions have been asked, but they are too advanced for me to understand or not to get step-by-step guidance from beginning to end (most of them are ultimately insider talk about their own experiment results). Well, here it is, given this simple program:
#include <stdio.h>
#include <string.h>
int main()
{
FILE * f;
char buffer[100];
memset(buffer, 0, 100);
fun();
f = fopen("main.cpp", "r");
fread(buffer, 1, 99, f);
printf(buffer);
fclose(f);
return 0;
}
What he does is basically print (suppose the file name is main.cpp).
Question
How can I print another file, say foobar.txtwithout changing the source code? This has something to do with running it through VS, going through functions, and grabbing the FILE pointer before it gets called fread(). No need to worry about a resource leak causing fclose().
f = fopen("foobar.txt", "r"),
CXX0017: Error: symbol "fopen" not found
?
Mozilla Windows. "" -
f = {,,MSVCR100D}fopen("foo.txt", "r")
:
- , .
{,,MSVCR100D} ? , MSVCR . ?- - , , ? , ?