Generic Subprograms

A LECTURE VIDEO ON GENERIC SUBPROGRAMS

Click here to view on YouTube

GENERIC SUBPROGRAMS

  • A generic subprograms is a subprogram which have parametric polymorphism.
  • A generic subprogram can accept different types of values of same single memory location.
  • Parametrically polymorphic subprograms are often called generic subprograms.
  • C++ provide a kind of compile-time parametric polymorphism.

For example Generic Functions in C++:

template <class Type>
void show(Type a) {
cout<<a;
}
void main()
{
show(10);
show(10.2);
show('c');
}


Principles of Programming Languages:

EasyExamNotes.com covered following topics in these notes.

Practicals:
Previous years solved papers:
A list of Video lectures
References:
  1. Sebesta,”Concept of programming Language”, Pearson Edu 
  2. Louden, “Programming Languages: Principles & Practices” , Cengage Learning 
  3. Tucker, “Programming Languages: Principles and paradigms “, Tata McGraw –Hill. 
  4. E Horowitz, "Programming Languages", 2nd Edition, Addison Wesley 

Share: