File tree 4 files changed +54
-2
lines changed
4 files changed +54
-2
lines changed Original file line number Diff line number Diff line change 128
128
</Link >
129
129
</ItemDefinitionGroup >
130
130
<ItemGroup >
131
- <ClCompile Include =" Exception-Basics.cpp" />
131
+ <ClInclude Include =" resource.h" />
132
+ </ItemGroup >
133
+ <ItemGroup >
134
+ <ClCompile Include =" Standard-Exceptions.cpp" />
132
135
</ItemGroup >
133
136
<Import Project =" $(VCTargetsPath)\Microsoft.Cpp.targets" />
134
137
<ImportGroup Label =" ExtensionTargets" >
Original file line number Diff line number Diff line change 15
15
</Filter >
16
16
</ItemGroup >
17
17
<ItemGroup >
18
- <ClCompile Include =" Exception-Basics .cpp" >
18
+ <ClCompile Include =" Standard-Exceptions .cpp" >
19
19
<Filter >Source Files</Filter >
20
20
</ClCompile >
21
+ <ClCompile Include =" Standard-Exceptions.cpp" >
22
+ <Filter >Source Files</Filter >
23
+ </ClCompile >
24
+ </ItemGroup >
25
+ <ItemGroup >
26
+ <ClInclude Include =" resource.h" >
27
+ <Filter >Header Files</Filter >
28
+ </ClInclude >
21
29
</ItemGroup >
22
30
</Project >
Original file line number Diff line number Diff line change
1
+ // Learn Advance C++ Programming
2
+ // Standard Exceptions
3
+
4
+ #include < iostream>
5
+ using namespace std ;
6
+
7
+ class CanGoWrong {
8
+ public:
9
+ CanGoWrong () {
10
+ char * pMemory = new char [99999999999999 ];
11
+ delete[] pMemory;
12
+ }
13
+ };
14
+
15
+
16
+ int main () {
17
+
18
+
19
+ try {
20
+ CanGoWrong wrong;
21
+ }
22
+ catch (bad_alloc &e) {
23
+ cout << " Caught Exception " << e.what () << endl;
24
+ }
25
+
26
+ return 0 ;
27
+ }
Original file line number Diff line number Diff line change
1
+ //{{NO_DEPENDENCIES}}
2
+ // Microsoft Visual C++ generated include file.
3
+ // Used by Advanced-Cpp-Programming.rc
4
+
5
+ // Next default values for new objects
6
+ //
7
+ #ifdef APSTUDIO_INVOKED
8
+ #ifndef APSTUDIO_READONLY_SYMBOLS
9
+ #define _APS_NEXT_RESOURCE_VALUE 101
10
+ #define _APS_NEXT_COMMAND_VALUE 40001
11
+ #define _APS_NEXT_CONTROL_VALUE 1001
12
+ #define _APS_NEXT_SYMED_VALUE 101
13
+ #endif
14
+ #endif
You can’t perform that action at this time.
0 commit comments