You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<
4EE7
script type="application/json" data-target="react-app.embeddedData">{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"Bit Manipulation","path":"Bit Manipulation","contentType":"directory"},{"name":"C++ iostreams","path":"C++ iostreams","contentType":"directory"},{"name":"C-practice","path":"C-practice","contentType":"directory"},{"name":"COPY CONSTRUCTOR","path":"COPY CONSTRUCTOR","contentType":"directory"},{"name":"Data Structures","path":"Data Structures","contentType":"directory"},{"name":"Dynamic Programming","path":"Dynamic Programming","contentType":"directory"},{"name":"Exception Handling","path":"Exception Handling","contentType":"directory"},{"name":"File Handling","path":"File Handling","contentType":"directory"},{"name":"General Programs","path":"General Programs","contentType":"directory"},{"name":"Generic Programming","path":"Generic Programming","contentType":"directory"},{"name":"NAMESPACES in C++","path":"NAMESPACES in C++","contentType":"directory"},{"name":"Operator Overloading","path":"Operator Overloading","contentType":"directory"},{"name":"Pointers","path":"Pointers","contentType":"directory"},{"name":"PreProcessors in CPP","path":"PreProcessors in CPP","contentType":"directory"},{"name":"REFERENCES in C++","path":"REFERENCES in C++","contentType":"directory"},{"name":"STL","path":"STL","contentType":"directory"},{"name":"this Pointer","path":"this Pointer","contentType":"directory"},{"name":".gitignore.txt","path":".gitignore.txt","contentType":"file"},{"name":"AbstractClass.cpp","path":"AbstractClass.cpp","contentType":"file"},{"name":"BaseMemberMethodusingObjectAsArg.cpp","path":"BaseMemberMethodusingObjectAsArg.cpp","contentType":"file"},{"name":"COPY CONSTRUCTOR2.cpp","path":"COPY CONSTRUCTOR2.cpp","contentType":"file"},{"name":"ClassesInsideFunctions.cpp","path":"ClassesInsideFunctions.cpp","contentType":"file"},{"name":"ConstFunctions.cpp","path":"ConstFunctions.cpp","contentType":"file"},{"name":"ConstKeyword.cpp","path":"ConstKeyword.cpp","contentType":"file"},{"name":"ConstPointers.cpp","path":"ConstPointers.cpp","contentType":"file"},{"name":"FriendFunction.cpp","path":"FriendFunction.cpp","contentType":"file"},{"name":"FunctionOverloading.cpp","path":"FunctionOverloading.cpp","contentType":"file"},{"name":"FunctionOverridingInheritence.cpp","path":"FunctionOverridingInheritence.cpp","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"NestedClasses.cpp","path":"NestedClasses.cpp","contentType":"file"},{"name":"OOP-2.cpp","path":"OOP-2.cpp","contentType":"file"},{"name":"OperatorOverloading1.cpp","path":"OperatorOverloading1.cpp","contentType":"file"},{"name":"OrderOfExecOfConstructorsDestructorsInheritence.cpp","path":"OrderOfExecOfConstructorsDestructorsInheritence.cpp","contentType":"file"},{"name":"PrivateInheritence.cpp","path":"PrivateInheritence.cpp","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"StaticClass.cpp","path":"StaticClass.cpp","contentType":"file"},{"name":"StaticVar.cpp","path":"StaticVar.cpp","contentType":"file"},{"name":"ThisPointer.cpp","path":"ThisPointer.cpp","contentType":"file"},{"name":"VirtualDestructor.cpp","path":"VirtualDestructor.cpp","contentType":"file"},{"name":"VirtualFuncInheritence.cpp","path":"VirtualFuncInheritence.cpp","contentType":"file"},{"name":"VirtualFunctions.cpp","path":"VirtualFunctions.cpp","contentType":"file"},{"name":"VirtualInheritenceAndDiamondProblem.cpp","path":"VirtualInheritenceAndDiamondProblem.cpp","contentType":"file"},{"name":"basic.cpp","path":"basic.cpp","contentType":"file"},{"name":"basic.exe","path":"basic.exe","contentType":"file"},{"name":"classBasic.cpp","path":"classBasic.cpp","contentType":"file"},{"name":"constClass.cpp","path":"constClass.cpp","contentType":"file"},{"name":"constructorOverloading.cpp","path":"constructorOverloading.cpp","contentType":"file"},{"name":"constructors.cpp","path":"constructors.cpp","contentType":"file"},{"name":"constructors.exe","path":"constructors.exe","contentType":"file"},{"name":"defaultConstructor.cpp","path":"defaultConstructor.cpp","contentType":"file"},{"name":"destructor.cpp","path":"destructor.cpp","contentType":"file"},{"name":"friendClass.cpp","path":"friendClass.cpp","contentType":"file"},{"name":"memoryDeallocationusingDestructor.cpp","path":"memoryDeallocationusingDestructor.cpp","contentType":"file"},{"name":"multipleInheritence.cpp","path":"multipleInheritence.cpp","contentType":"file"},{"name":"protectedInheritence.cpp","path":"protectedInheritence.cpp","contentType":"file"},{"name":"publicInheritence.cpp","path":"publicInheritence.cpp","contentType":"file"}],"totalCount":56}},"fileTreeProcessingTime":26.050395,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":113080697,"defaultBranch":"master","name":"Programming-in-Cpp","ownerLogin":"anishsingh20","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2017-12-04T18:42:13.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/15655876?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1527623696.0","canEdit":false,"refType":"branch","currentOid":"de5dfecb715ce6ed9a59d54aedc1aab4f06703a3"},"path":"NestedClasses.cpp","currentUser":null,"blob":{"rawLines":["#include\u003ciostream\u003e","using namespace std;","","//Nested classes-classes defined inside a class","","","class Person {","\tpublic:","\t\t string name;","\t","\tclass Anish {","\t\tpublic:","\t\t\tstring address;","\t\t\tstring city;","\t\t\tstring country;","\t\t\t","\t\t\t","\t\t","\t\t\t\t","\t};","\t//we need to define object of nested class to access its members inside Parent class","\t","\tAnish a; //object created","\tvoid getadd()","\t{","\t\tcout\u003c\u003c\"Name: \"\u003c\u003cname\u003c\u003cendl\u003c\u003c\"Address:\"\u003c\u003ca.address\u003c\u003cendl\u003c\u003c\"City: \"\u003c\u003ca.city\u003c\u003cendl\u003c\u003c\"Country: \"\u003c\u003ca.country\u003c\u003cendl;","\t}","\t","\t","\t\t\t","};","","int main() {","\tPerson p;","\t//creating object of nested clas outiside Parent class throws error","\t//Person::Anish an; //need to use scope resolution operator","\tp.a.address=\"Hari Kunj\";","\tp.a.city=\"Dehradun\";","\tp.a.country=\"India\";","\tp.name=\"Anish\";","\tp.getadd();","\treturn 0;","\t","}"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/anishsingh20/Programming-in-Cpp/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"NestedClasses.cpp","displayUrl":"https://github.com/anishsingh20/Programming-in-Cpp/blob/master/NestedClasses.cpp?raw=true","headerInfo":{"blobSize":"762 Bytes","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"6b74aaa","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fanishsingh20%2FProgramming-in-Cpp%2Fblob%2Fmaster%2FNestedClasses.cpp","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"44","truncatedSloc":"30"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"C++","languageID":43,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/anishsingh20/Programming-in-Cpp/blob/master/NestedClasses.cpp","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/anishsingh20/Programming-in-Cpp/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/anishsingh20/Programming-in-Cpp/raw/refs/heads/master/NestedClasses.cpp","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/anishsingh20/Programming-in-Cpp/branches":{"post":"GZXn6TJww3CUIWa0fs78L0k8vKvmiLnzQkk1f8Q9aMEmjRDKmecEDYuvetFgRD9_E-MXv6YAIFqbNVOSVCH6Wg"},"/repos/preferences":{"post":"EOY06FOU1r8nwNkxNAFBFZkC5kxtyg782yEbQbYLZowEpLBAA8DcDX1VzD2exvKDZSavGmrH8iDk1LkNicqVmA"}}},"title":"Programming-in-Cpp/NestedClasses.cpp at master · anishsingh20/Programming-in-Cpp","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}