Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dbb3009

Browse files
understand way of inheritance
1 parent 985a5f9 commit dbb3009

File tree

10 files changed

+485
-3
lines changed

10 files changed

+485
-3
lines changed
6 KB
Binary file not shown.

‎Learn_CPP_Programming_Deep_Dive/Section 13 Inheritance/Constructors_in_inheritance/Constructors_in_inheritance/Constructors_in_inheritance.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
DEA3A8212AFAB35200708271 = {
4242
isa = PBXGroup;
4343
children = (
44+
DEA3A8342AFAC5C700708271 /* New Group */,
4445
DEA3A82C2AFAB35200708271 /* Constructors_in_inheritance */,
4546
DEA3A82B2AFAB35200708271 /* Products */,
4647
);
@@ -62,6 +63,13 @@
6263
path = Constructors_in_inheritance;
6364
sourceTree = "<group>";
6465
};
66+
DEA3A8342AFAC5C700708271 /* New Group */ = {
67+
isa = PBXGroup;
68+
children = (
69+
);
70+
path = "New Group";
71+
sourceTree = "<group>";
72+
};
6573
/* End PBXGroup section */
6674

6775
/* Begin PBXNativeTarget section */
6.6 KB
Binary file not shown.

‎Learn_CPP_Programming_Deep_Dive/Section 13 Inheritance/Constructors_in_inheritance/Constructors_in_inheritance/Constructors_in_inheritance/main.cpp

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,51 @@
66
//
77

88
#include <iostream>
9+
using namespace std;
910

10-
int main(int argc, const char * argv[]) {
11-
// insert code here...
12-
std::cout << "Hello, World!\n";
11+
class Base_Class
12+
{
13+
public:
14+
Base_Class()
15+
{
16+
cout<<"This is a non-parametrized constructor of Base class"<<endl;
17+
}
18+
19+
Base_Class(int x)
20+
{
21+
cout<<"This is a parametrized constructor of Base class"<<x<<endl;
22+
}
23+
};
24+
25+
class Derived_Class: public Base_Class
26+
{
27+
public:
28+
Derived_Class()
29+
{
30+
cout<<"This is a non-parametrized constructor of Derived Class "<<endl;
31+
}
32+
33+
Derived_Class(int x)
34+
{
35+
cout<<"This a parametrized constructor of Derived Class "<<x<<endl;
36+
}
37+
38+
Derived_Class(int x, int y) : Base_Class(y)
39+
{
40+
cout<<"This is a parametrized constructor of Derived Class "<<x<<"\t"<<y<<endl;
41+
}
42+
};
43+
44+
45+
int main(int argc, const char * argv[])
46+
{
47+
Derived_Class d1;
48+
49+
Derived_Class d2(12);
50+
51+
Derived_Class d3(12,45);
52+
53+
54+
1355
return 0;
1456
}
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 56;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
DEA3A8422AFAC61000708271 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEA3A8412AFAC61000708271 /* main.cpp */; };
11+
/* End PBXBuildFile section */
12+
13+
/* Begin PBXCopyFilesBuildPhase section */
14+
DEA3A83C2AFAC61000708271 /* CopyFiles */ = {
15+
isa = PBXCopyFilesBuildPhase;
16+
buildActionMask = 2147483647;
17+
dstPath = /usr/share/man/man1/;
18+
dstSubfolderSpec = 0;
19+
files = (
20+
);
21+
runOnlyForDeploymentPostprocessing = 1;
22+
};
23+
/* End PBXCopyFilesBuildPhase section */
24+
25+
/* Begin PBXFileReference section */
26+
DEA3A83E2AFAC61000708271 /* Way_of_inheritance */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Way_of_inheritance; sourceTree = BUILT_PRODUCTS_DIR; };
27+
DEA3A8412AFAC61000708271 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
28+
/* End PBXFileReference section */
29+
30+
/* Begin PBXFrameworksBuildPhase section */
31+
DEA3A83B2AFAC61000708271 /* Frameworks */ = {
32+
isa = PBXFrameworksBuildPhase;
33+
buildActionMask = 2147483647;
34+
files = (
35+
);
36+
runOnlyForDeploymentPostprocessing = 0;
37+
};
38+
/* End PBXFrameworksBuildPhase section */
39+
40+
/* Begin PBXGroup section */
41+
DEA3A8352AFAC61000708271 = {
42+
isa = PBXGroup;
43+
children = (
44+
DEA3A8402AFAC61000708271 /* Way_of_inheritance */,
45+
DEA3A83F2AFAC61000708271 /* Products */,
46+
);
47+
sourceTree = "<group>";
48+
};
49+
DEA3A83F2AFAC61000708271 /* Products */ = {
50+
isa = PBXGroup;
51+
children = (
52+
DEA3A83E2AFAC61000708271 /* Way_of_inheritance */,
53+
);
54+
name = Products;
55+
sourceTree = "<group>";
56+
};
57+
DEA3A8402AFAC61000708271 /* Way_of_inheritance */ = {
58+
isa = PBXGroup;
59+
children = (
60+
DEA3A8412AFAC61000708271 /* main.cpp */,
61+
);
62+
path = Way_of_inheritance;
63+
sourceTree = "<group>";
64+
};
65+
/* End PBXGroup section */
66+
67+
/* Begin PBXNativeTarget section */
68+
DEA3A83D2AFAC61000708271 /* Way_of_inheritance */ = {
69+
isa = PBXNativeTarget;
70+
buildConfigurationList = DEA3A8452AFAC61000708271 /* Build configuration list for PBXNativeTarget "Way_of_inheritance" */;
71+
buildPhases = (
72+
DEA3A83A2AFAC61000708271 /* Sources */,
73+
DEA3A83B2AFAC61000708271 /* Frameworks */,
74+
DEA3A83C2AFAC61000708271 /* CopyFiles */,
75+
);
76+
buildRules = (
77+
);
78+
dependencies = (
79+
);
80+
name = Way_of_inheritance;
81+
productName = Way_of_inheritance;
82+
productReference = DEA3A83E2AFAC61000708271 /* Way_of_inheritance */;
83+
productType = "com.apple.product-type.tool";
84+
};
85+
/* End PBXNativeTarget section */
86+
87+
/* Begin PBXProject section */
88+
DEA3A8362AFAC61000708271 /* Project object */ = {
89+
isa = PBXProject;
90+
attributes = {
91+
BuildIndependentTargetsInParallel = 1;
92+
LastUpgradeCheck = 1500;
93+
TargetAttributes = {
94+
DEA3A83D2AFAC61000708271 = {
95+
CreatedOnToolsVersion = 15.0.1;
96+
};
97+
};
98+
};
99+
buildConfigurationList = DEA3A8392AFAC61000708271 /* Build configuration list for PBXProject "Way_of_inheritance" */;
100+
compatibilityVersion = "Xcode 14.0";
101+
developmentRegion = en;
102+
hasScannedForEncodings = 0;
103+
knownRegions = (
104+
en,
105+
Base,
106+
);
107+
mainGroup = DEA3A8352AFAC61000708271;
108+
productRefGroup = DEA3A83F2AFAC61000708271 /* Products */;
109+
projectDirPath = "";
110+
projectRoot = "";
111+
targets = (
112+
DEA3A83D2AFAC61000708271 /* Way_of_inheritance */,
113+
);
114+
};
115+
/* End PBXProject section */
116+
117+
/* Begin PBXSourcesBuildPhase section */
118+
DEA3A83A2AFAC61000708271 /* Sources */ = {
119+
isa = PBXSourcesBuildPhase;
120+
buildActionMask = 2147483647;
121+
files = (
122+
DEA3A8422AFAC61000708271 /* main.cpp in Sources */,
123+
);
124+
runOnlyForDeploymentPostprocessing = 0;
125+
};
126+
/* End PBXSourcesBuildPhase section */
127+
128+
/* Begin XCBuildConfiguration section */
129+
DEA3A8432AFAC61000708271 /* Debug */ = {
130+
isa = XCBuildConfiguration;
131+
buildSettings = {
132+
ALWAYS_SEARCH_USER_PATHS = NO;
133+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
134+
CLANG_ANALYZER_NONNULL = YES;
135+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
136+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
137+
CLANG_ENABLE_MODULES = YES;
138+
CLANG_ENABLE_OBJC_ARC = YES;
139+
CLANG_ENABLE_OBJC_WEAK = YES;
140+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
141+
CLANG_WARN_BOOL_CONVERSION = YES;
142+
CLANG_WARN_COMMA = YES;
143+
CLANG_WARN_CONSTANT_CONVERSION = YES;
144+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
145+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
146+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
147+
CLANG_WARN_EMPTY_BODY = YES;
148+
CLANG_WARN_ENUM_CONVERSION = YES;
149+
CLANG_WARN_INFINITE_RECURSION = YES;
150+
CLANG_WARN_INT_CONVERSION = YES;
151+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
152+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
153+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
154+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
155+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
156+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
157+
CLANG_WARN_STRICT_PROTOTYPES = YES;
158+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
159+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
160+
CLANG_WARN_UNREACHABLE_CODE = YES;
161+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
162+
COPY_PHASE_STRIP = NO;
163+
DEBUG_INFORMATION_FORMAT = dwarf;
164+
ENABLE_STRICT_OBJC_MSGSEND = YES;
165+
ENABLE_TESTABILITY = YES;
166+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
167+
GCC_C_LANGUAGE_STANDARD = gnu17;
168+
GCC_DYNAMIC_NO_PIC = NO;
169+
GCC_NO_COMMON_BLOCKS = YES;
170+
GCC_OPTIMIZATION_LEVEL = 0;
171+
GCC_PREPROCESSOR_DEFINITIONS = (
172+
"DEBUG=1",
173+
"$(inherited)",
174+
);
175+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
176+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
177+
GCC_WARN_UNDECLARED_SELECTOR = YES;
178+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
179+
GCC_WARN_UNUSED_FUNCTION = YES;
180+
GCC_WARN_UNUSED_VARIABLE = YES;
181+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
182+
MACOSX_DEPLOYMENT_TARGET = 14.0;
183+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
184+
MTL_FAST_MATH = YES;
185+
ONLY_ACTIVE_ARCH = YES;
186+
SDKROOT = macosx;
187+
};
188+
name = Debug;
189+
};
190+
DEA3A8442AFAC61000708271 /* Release */ = {
191+
isa = XCBuildConfiguration;
192+
buildSettings = {
193+
ALWAYS_SEARCH_USER_PATHS = NO;
194+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
195+
CLANG_ANALYZER_NONNULL = YES;
196+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
197+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
198+
CLANG_ENABLE_MODULES = YES;
199+
CLANG_ENABLE_OBJC_ARC = YES;
200+
CLANG_ENABLE_OBJC_WEAK = YES;
201+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
202+
CLANG_WARN_BOOL_CONVERSION = YES;
203+
CLANG_WARN_COMMA = YES;
204+
CLANG_WARN_CONSTANT_CONVERSION = YES;
205+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
206+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
207+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
208+
CLANG_WARN_EMPTY_BODY = YES;
209+
CLANG_WARN_ENUM_CONVERSION = YES;
210+
CLANG_WARN_INFINITE_RECURSION = YES;
211+
CLANG_WARN_INT_CONVERSION = YES;
212+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
213+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
214+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
215+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
216+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
217+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
218+
CLANG_WARN_STRICT_PROTOTYPES = YES;
219+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
220+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
221+
CLANG_WARN_UNREACHABLE_CODE = YES;
222+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
223+
COPY_PHASE_STRIP = NO;
224+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
225+
ENABLE_NS_ASSERTIONS = NO;
226+
ENABLE_STRICT_OBJC_MSGSEND = YES;
227+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
228+
GCC_C_LANGUAGE_STANDARD = gnu17;
229+
GCC_NO_COMMON_BLOCKS = YES;
230+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
231+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
232+
GCC_WARN_UNDECLARED_SELECTOR = YES;
233+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
234+
GCC_WARN_UNUSED_FUNCTION = YES;
235+
GCC_WARN_UNUSED_VARIABLE = YES;
236+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
237+
MACOSX_DEPLOYMENT_TARGET = 14.0;
238+
MTL_ENABLE_DEBUG_INFO = NO;
239+
MTL_FAST_MATH = YES;
240+
SDKROOT = macosx;
241+
};
242+
name = Release;
243+
};
244+
DEA3A8462AFAC61000708271 /* Debug */ = {
245+
isa = XCBuildConfiguration;
246+
buildSettings = {
247+
CODE_SIGN_STYLE = Automatic;
248+
PRODUCT_NAME = "$(TARGET_NAME)";
249+
};
250+
name = Debug;
251+
};
252+
DEA3A8472AFAC61000708271 /* Release */ = {
253+
isa = XCBuildConfiguration;
254+
buildSettings = {
255+
CODE_SIGN_STYLE = Automatic;
256+
PRODUCT_NAME = "$(TARGET_NAME)";
257+
};
258+
name = Release;
259+
};
260+
/* End XCBuildConfiguration section */
261+
262+
/* Begin XCConfigurationList section */
263+
DEA3A8392AFAC61000708271 /* Build configuration list for PBXProject "Way_of_inheritance" */ = {
264+
isa = XCConfigurationList;
265+
buildConfigurations = (
266+
DEA3A8432AFAC61000708271 /* Debug */,
267+
DEA3A8442AFAC61000708271 /* Release */,
268+
);
269+
defaultConfigurationIsVisible = 0;
270+
defaultConfigurationName = Release;
271+
};
272+
DEA3A8452AFAC61000708271 /* Build configuration list for PBXNativeTarget "Way_of_inheritance" */ = {
273+
isa = XCConfigurationList;
274+
buildConfigurations = (
275+
DEA3A8462AFAC61000708271 /* Debug */,
276+
DEA3A8472AFAC61000708271 /* Release */,
277+
);
278+
defaultConfigurationIsVisible = 0;
279+
defaultConfigurationName = Release;
280+
};
281+
/* End XCConfigurationList section */
282+
};
283+
rootObject = DEA3A8362AFAC61000708271 /* Project object */;
284+
}

‎Learn_CPP_Programming_Deep_Dive/Section 13 Inheritance/Way_of_inheritance/Way_of_inheritance/Way_of_inheritance.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
15.4 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>Way_of_inheritance.xcscheme_^#shared#^_</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
</dict>
14+
</plist>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /