Skip to content

Commit 264abc4

Browse files
committed
.
1 parent 7505209 commit 264abc4

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

Advanced-Cpp-Programming.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<ClInclude Include="Template Classes and Functions\Template-class.h" />
135135
</ItemGroup>
136136
<ItemGroup>
137-
<ClCompile Include="Cpp%2711 New features\unique-pointers.cpp" />
137+
<ClCompile Include="Cpp%2711 New features\Shared-pointers.cpp" />
138138
<ClCompile Include="Operator Overloading\Complex.cpp" />
139139
</ItemGroup>
140140
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

Advanced-Cpp-Programming.vcxproj.filters

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<ClCompile Include="Operator Overloading\Complex.cpp">
3333
<Filter>Source Files</Filter>
3434
</ClCompile>
35-
<ClCompile Include="Cpp%2711 New features\unique-pointers.cpp">
35+
<ClCompile Include="Cpp%2711 New features\Shared-pointers.cpp">
3636
<Filter>Source Files</Filter>
3737
</ClCompile>
3838
</ItemGroup>
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Learn Advanced C++ programming
2+
// Shared Pointers
3+
4+
#include<iostream>
5+
using namespace std;
6+
7+
8+
class Test {
9+
public:
10+
Test() {
11+
cout << "created" << endl;
12+
}
13+
14+
void greet() {
15+
cout << "hello" << endl;
16+
}
17+
18+
~Test() {
19+
cout << "destroyed" << endl;
20+
}
21+
22+
};
23+
24+
25+
int main() {
26+
27+
shared_ptr<Test> pTest1 = make_shared<Test>();
28+
29+
30+
31+
cout << "Finished" << endl;
32+
return 0;
33+
}
34+

0 commit comments

Comments
 (0)