diff --git a/segment default b/segment default new file mode 100644 index 0000000..03ddc46 --- /dev/null +++ b/segment default @@ -0,0 +1,30 @@ +// C++ program to demonstrate Segmentation Fault +#include +using namespace std; + +// Driver Code +int main() +{ + // An array of size 100 + int arr[100] = { 0 }; + + // When we try to access the array out + // of bound, it will give Segmentation Fault + cout << arr[100001]; + return 0; +} +// C++ program to demonstrate TLE +#include +using namespace std; + +// Driver Code +int main() +{ + // Below statement will give time + // limit exceeded as well as memory + // limit exceeded due to infinite loop + for (;;) { + int arr[10000]; + } + return 0; +}