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);
- There is an unhandled exception at: 0xc0000005: an access conflict occurred while reading location 0x00000000.
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- The problem of strncpy and the solution of GCC compile time checking
- VC Critical error detected c0000374 crash problem and solution
- error C4996: ‘scanf‘: This function or variable may be unsafe.Visual Studio Series compilers report errors using scanf function
- Unhandled exception: 0xc0000005: access violation while reading location 0x00000000
- Rtklib DLL compilation and error link_ Showmsg error resolution
- Memory error unhandled exception: 0xc0000005: read location: 0x00000
- A solution to [error] LD returned 1 exit status
- Some common problems in the use of vs2017
- [Warning] incompatible implicit declaration of built-in function ‘strcat’
- How to use C + + function pointer array
- 0xc0000005: solution to access conflict when writing to location 0x00000000
- MSDN I tell you new site next I tell you open invitation code registration! Today’s quota is 5000!
- Cause of runtime error on OJ
- The compilation error appears with lvalue required as Increment operand
- How to Use the Reverse() Function
- Use of C + + ifstream and error handling
- error: declaration may not appear after executable statement in block
- Error c2061: syntax error: identifier ‘this_ FILE’