Describe: When I was compilling my c programme on visual studio2013 i met such error code like :
"Unhandled exception at 0x7B408B51 (msvcr120d.dll) in Project1.exe: 0xC0000005: Access violation reading location 0x00000065."
IDA_ Files1 is the resource file that I call
code:
#define _CRT_SECURE_NO_WARNINGS
#include"resource.h"
#include<Windows.h>
#include<stdio.h>
int main()
{
FILE *fp = fopen((char *)IDR_FILES1, "r");
if (fp == NULL)
{
printf("failed");
while (1);
}
system("pause");
}
I have tried my best to find a anser on google but failed.I'm look forward to anyone's answer
Let me give you some beginners explanation:
A computer program (in Windows, an *.exe file), is in fact a bunch of internal commands, like "Put this information somewhere in memory", "change this information in memory", "jump to that instruction, somewhere in memory", ..., things like that.
Writing computer source code, is more like: "Calculate a variable", "loop until a certain condition is met", "show something on screen", ...
As you see, both are different, which means that what you have written (source code) must be translated into a format that the computer understands. This is called "Compiling". The result of most compiling is, as you can guess, an *.exe file (it can also be a DLL but this would lead us too far).
So, when you have an error message, like "... in Project1.exe", then this means that the *.exe file has already been created, hence it can't be a compiler's problem, so it's a runtime problem (something is going wrong while running, not compiling, your program).
User contributions licensed under CC BY-SA 3.0