Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 704 Bytes

CppAccessViolation.md

File metadata and controls

15 lines (11 loc) · 704 Bytes

An access violation is a type of run-time error in which the program reads or writes to non-allocated memory. In the example below, an array is declared, after which the space in memory beyond it is set to zero:


int main() {   int v[1];   v[1] = 0; //Access violation! }

Access violations are not always detected (try the code above, it might just reach the end) and therefore difficult to debug.