+
Skip to content

ngtina99/cpp07

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Module 07

This module introduces C++ templates by implementing generic functions and a custom array class. It explores how to write type-agnostic, reusable code.

🛠️ Usage

For each exercise, navigate to its folder, compile, and run:

📂 ex00

cd ex00
make
./whatever

📂 ex01

cd ex01
make
./iter

📂 ex02

cd ex02
make
./array

📝 Exercise Descriptions

ex00 — Start with a few functions: Implement function templates swap(), min(), and max() that work on any type supporting comparison and assignment. Test with both integers and strings.

ex01 — Iter: Implement a template function iter() that applies a given function to each element of an array. It must handle both const and non-const arrays and support any type.

ex02 — Array: Implement a class template Array with dynamic memory, safe element access, deep copy, bounds checking, and a size() method. Mimic basic behavior of std::vector without using STL.

💼 Connect

If you have any questions or suggestions, feel free to connect: 🔗 LinkedIn: Valentina Nguyen 🙋‍♀️

🖥️ System Compatibility

This project was developed and tested on Linux (Ubuntu).

About

I discovered C++ templates and applied them to various default functions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载