jrainpre / CPP07

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ Module 07 - C++ templates

Welcome to the repository for C++ Module 07. Explore the fascinating world of C++ templates.

πŸ“œ Introduction

C++ is a versatile programming language that builds upon C to introduce Object-Oriented Programming. This module aligns with the C++98 standard and provides exercises focusing on C++ templates.

πŸ“Œ Exercises

Exercise 00: Start with a few functions

  • Function Templates: Implement swap, min, and max function templates that work with any datatype supporting comparison operators.

Exercise 01: Iter

  • Function Template: Implement a function template named 'iter' that accepts an array, its length, and a function. It applies the given function to each element of the array.

Exercise 02: Array

  • Class Template: Implement a class template named 'Array' to hold elements of any type. It should support array operations like accessing elements with the subscript operator.
  • Error Handling: Handle out-of-bounds access using exceptions.

πŸš€ Compilation & Usage

Ensure you're on a system with a C++ compiler.

Compilation

Compile the exercises with the provided Makefile.

make

Execution

Execute the desired exercise. For example:

./start_with_functions input.txt

About


Languages

Language:C++ 60.7%Language:Makefile 39.3%