Recently, I began to learn C language systematically and use scanf in vs2019_ An error occurred when s assigned a value to a string. The error is as follows:
the exception raised at the location of 0x7837ef8c (ucrtbased. DLL) (located in project2.exe): 0xc0000005: an access conflict occurred when writing to the location of 0x01342000
*
after querying some data, we find that this problem should be solved because scanf is encouraged in vs2019 compiler_ S function to prevent the original scanf function array out of bounds( Using scanf function in vs2019 will report an error (compilation failed)
#define WORD_SIZE 26
char name[WORD_SIZE];
scanf_s("%s",name);
If so, an error will be reported.
If we provide the array name and length, we can compile it.
#define WORD_SIZE 26
char name[WORD_SIZE];
scanf_s("%s",name,WORD_SIZE);
Read More:
- 0xc0000005: solution to access conflict when writing to location 0x00000000
- Opencv: 0xc0000005: an access conflict occurred while reading location 0x0000000010
- 0xc0000005: an access conflict occurred while reading location 0x00000020
- There is an unhandled exception at: 0xc0000005: an access conflict occurred while reading location 0x00000000.
- Bug resolution of 0xc0000005: access conflict occurred when reading location of 0x00000000.
- Three possibilities of “unhandled exception: 0xc0000005: access conflict when reading location 0x00000000”
- VC + + COM programming error of 0xc0000005: access conflict when reading location 0xfeefef6
- C / C + + error handling (document): unhandled exception: 0xc0000005: access violation while reading location 0x00000000
- Unhandled exception: 0xc0000005: access violation while reading location 0x00000000
- [debug notes] pointer error when STD:: vector is used in VTK “access conflict when reading location XXX”
- Memory error unhandled exception: 0xc0000005: read location: 0x00000
- Solutions to the problem of “collect2.exe: error: LD returned 1” exit “status when writing C + + with vscode
- Error 1310 Error writing to file:C:\Windows\…*.dll. Verify that you have access to that directory
- When installing oracle12c, the problem of “unable to check whether the specified location is on CFS” appears
- C language — to solve the problem of program flashback when programming (in VS)
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- C language string processing error warning, c4996, sprintf, predicted, c4996, strcpy, c4996, strcat
- Error c2137 of C language: empty character constant (Fixed)
- Solution to error [error] LD returned 1 exit status in C language
- Error: lnk1168. Unable to open e::: language ⁃ project3 ⁃ debug ⁃ project3.exe for writing