Zebra0.com

cpp templatesIntroduction to C++ Programming

Introduction to C++ Programming

Learn C++ in step-by-step lessons.

Templates

A template provides a way to write a function that will work with many different data types. Instead of writing one function to sort integers, another to sort strings, and another to sort double, we can write just one function using a template.

Please study the material at each of the links below.

  1. A Template function to return minimum of 2 values.

  2. A Template function to show 3 values

  3. A Template function to sort 3 values

  4. Using swap

  5. Finding a total

  6. A Template bubble sort

  7. A Template bubble sort with function prototype

GlossaryGlossary for templates lesson
Full Glossary