Real life examples? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Real life examples?

Can someone give me real life example of classes and objects used in real code? You can write your own code for a response, or use already written code by you or literally anyone. Edit: The code itself doesn't have to be runnable on Sololearn. I'm simply examining the code.

11th Mar 2019, 11:32 PM
Daniel Cooper
Daniel Cooper - avatar
1 Answer
0
This is a very basic program that simply prints the walls and floor of what would become a C++ console output game. although the output is very simple I use a class and struct to handle attributes and store these collections of attributes (objects) in a list. Below i will put links to two programs. 1.) simply prints the map dimensions (no Classes) https://code.sololearn.com/cuvhh01dcJci/#cpp 2.)uses a class system to identify and store collections of attributes for later handling and manipulation https://code.sololearn.com/cCB5dIt2MB4U/#cpp Also ill add a link to one of my projects in C++ that is a console output text based game. Its primarily object oriented and will compile if you pull it down. It is far from finished, but it will show how you use classes more fully. *Fair warning, the GITHUB project was a practice project were I primarily only used pointers. https://github.com/joshuashaver/Cpp-stuff/tree/master/TextBasedGameWithPointers Hope this helps!
13th Mar 2019, 12:26 AM
Joshua Shaver
Joshua Shaver - avatar