The program crashes: Segmentation fault This family of problem is extremely large and contains two main sort of errors: access to non-authorized part of the memory and system calls with incorrect parameter values. Unauthorized memory access It when you try to read or write to a memory address 1. totally meaningless (for instance a non-initialized pointer) 2. out of bounds 3. not allocated anymore Note that a memory access with an unitialized pointer may corrupt the memory without actually crashing the program. For instance #include <iostream> int main(int argc, char **argv) { int b; int a[10]; b = 4; for(int i = 0; i < 100; i++) { a[i] = 12; cout << b << " "; cout.flush(); } }
Learn C++ Programming fast and easy, find C++ Program Codes