User Tools

Site Tools


notes:cprog:fall2021:projects:oop0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:cprog:fall2021:projects:oop0 [2021/10/28 03:34] – [References] hhemlernotes:cprog:fall2021:projects:oop0 [2021/10/28 03:51] (current) – [Backstory of C++ Programming language] hhemler
Line 50: Line 50:
 OOP makes it possible to create reusable applications with less code and a shorter development time.   OOP makes it possible to create reusable applications with less code and a shorter development time.  
 ====Classes==== ====Classes====
-User defined types. +User defined data types. 
 Classes make it easier to work with data by providing users with the ability to create constructors, destructors, member data, member functions, and more. Classes make it easier to work with data by providing users with the ability to create constructors, destructors, member data, member functions, and more.
  
-==Methods== +==Member Data==  
-Methods are functions that belong to a class.  The two ways to define a function that belongs to a class are inside the class definition and outside the class definition.  In order to define a method outside the class definition, you must first declare it inside the class.  You can then define your function outside of the class by specifying the name of the class and following it with the "::" operator.+In C++, you can define data inside of classes for the sake of using them with member functions. Access specifiers can be used to determine where these variables can be called from, and which functions can call them. (This is further described down below) 
 + 
 +==Methods (Member Functions)== 
 +Methods are functions that belong to a class.  The two ways to define a function that belongs to a class are inside the class definition and outside the class definition.  In order to define a method outside the class definition, you must first declare it inside the class.  You can then define your function outside of the class by specifying the name of the class and following it with the "::" operator. These functions are meant to be used alongside member data.
  
 ==Constructors== ==Constructors==
Line 98: Line 101:
  
 ====Objects==== ====Objects====
-Instances of a class. Creating an object of a class works almost exactly like initializing any fundamental type; simply specify the the type name, followed by your variable's name.+Instances of a class. Creating an object of a class works almost exactly like initializing any fundamental type; simply specify the the type name, followed by your variable's name. Objects are introduced by declarations
 =====Program===== =====Program=====
 Write a program that creates one or more of the following classes: Write a program that creates one or more of the following classes:
notes/cprog/fall2021/projects/oop0.1635392066.txt.gz · Last modified: 2021/10/28 03:34 by hhemler