Docsity

Function Templates in C++: Writing Independent Code for Processing Different Data Types, Lecture notes of Computer Programming

Partial preview of the text

Download Function Templates in C++: Writing Independent Code for Processing Different Data Types and more Lecture notes Computer Programming in PDF only on Docsity!

FUNCTION TEMPLATE

  • (^) Mubashra Munir 18CS
  • (^) Saira Siddique 18CS

FUNCTION+TEMPLATES

FUNCTION

Named block of code that performs some action. Syntax: Return-type function name(parameters)

TEMPLATE

Foundation of generic programming, writing code in a way that is independent of any particular type. Syntax: template T FunctionName(T Parameter(s))