Bug resolution of 0xc0000005: access conflict occurred when reading location of 0x00000000.

The error is as follows:


Error cause:
There’s a section in the program called cout <; < string; //char string[] But didn't notice that string can also be NULL, This leads to errors. Error analysis: When string is a null pointer, cout calls strlen to get the length of the string before printing it. So you need to access the null pointer (that is, the memory address of 0), and once the program accesses this memory, the system raises an exception, thus reporting an error.

Read More: