Skip to content

Project for learning about the fundamentals of C++

Notifications You must be signed in to change notification settings

Nipsu24/42_CPP_Modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPP Modules

Hive Helsinki (School 42) 12th curriculum project (Rank04)

About

The repository contains several modules consisting of different exercises related to the basics of C++ programming.

Modules

CPP00
  • ex00:
    • familiarizes with basic C++ concepts such as string class, related functions and cout.
  • ex01:
    • introduces classes initialization, cin object of isstream class and further string manipulation and formatting possibilities such as .substr(), .setw(), and .length(). Additionally try / catch statements are used.
    • Sets up a phone book by initialising a class 'PhoneBook', containing 8 classes of contacts
    • user has options between the 3 commands ADD, SEARCH and EXIT which respectively adds contacts (and their details), searches for contacts (first displays entire list of contacts, then by entering index shows contact details) or exits the phone book
    • in case of invalid input, errors are displayed to the user
CPP01
  • ex00:
    • introduces new for allocating memory for a class
    • learning about initialising classes on heap vs. stack
  • ex01:
    • learning about array of classes using new for memory allocation
  • ex02:
    • introduces concept of references
  • ex03:
    • reference vs. pointer to a class
    • object which contains pointer to a class can be initialised without explicitly assigning value to the class whereby reference requires the object of the class not to be empty
  • ex04:
    • introduces concepts of ifstream and ofstream
    • further string manipulation such as .find(), .erase(), .insert()
    • user can give 3 arguments to the program (file name, string1 and string2), the content of the file given to the program is copied into another created file and then the sequence of string2 replaces sequence of string1 (if existing), prints errors in case of invalid arguments
  • ex05:
    • introduces concept of function pointers in C++
  • ex06:
    • introduces concept of switch statements
CPP02
  • ex00:
    • set up of classes in orthodox canonical form
    • learning about copy constructor and copy-assignment constructor
    • fixed point vs floating point vs integer representation
  • ex01:
    • introduces concept of operator overloading
  • ex02:
    • further operator overloading for <, >, !=, ==, >=, <=, ++, --

Requirements

-c++ compiler

Instructions

1. Compiling the respective executables

To compile the executables of the different exercises, cd into the exercise folder in question and run:

$ make

2. Cleaning all binary (.o) and executable files (.a)

To delete all files generated with make, run:

$ make fclean

About

Project for learning about the fundamentals of C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published