Search your topic here

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');
}

LEAVE A REPLY










Related topics

Please use contact page in this website if you find anything incorrect or you want to share more information about the topic discussed above.