🧩 C++ Templates (Generics)

Templates let you write a single function or class that works with any data type — like C# generics or TypeScript templates.

📚 Example: Template Function

Console output will appear here...
💡 Pro Tip: Use template <typename T> before your function or class to create a template for any type. You can also use template <class T> — it works the same.

🔧 Syntax Breakdown