From eea79968e213413e7b6e186397e00e5d66340ee6 Mon Sep 17 00:00:00 2001 From: Selva Muthu Kumaran <86711942+selvamuthukumaran1@users.noreply.github.com> Date: Sat, 26 Aug 2023 00:09:37 +0530 Subject: [PATCH] Fix data type content (#4381) data type (struct and class) clarification --- src/data/roadmaps/cpp/content/104-data-types/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/roadmaps/cpp/content/104-data-types/index.md b/src/data/roadmaps/cpp/content/104-data-types/index.md index 474f805f4..76096783c 100644 --- a/src/data/roadmaps/cpp/content/104-data-types/index.md +++ b/src/data/roadmaps/cpp/content/104-data-types/index.md @@ -85,7 +85,7 @@ int& numRef = num; User-defined data types are types that are defined by the programmer, such as structures, classes, and unions. ## Structures (struct) -Structures are used to group variables of different data types together under a single name. +Structures are used to store different data tyes under a single variable and accessibility of member variables and methods are public. Example: ```cpp @@ -99,7 +99,7 @@ Person p1 = {"John Doe", 30, 5.9}; ``` ## Classes (class) -Classes are similar to structures, but they can also have member functions and access specifiers. +Classes are similar to structures, but the accessibility of the member data and function are governed by access specifiers. By default access to members of a class is private. Example: ```cpp @@ -131,4 +131,4 @@ union Data { Data myData; myData.num = 42; -``` \ No newline at end of file +```