C++

Objectives :

  • Using Key word typename than class
    template <typename VariousType>
    void Show(VariousType value)
    {
    cout<< " \n Round : "<< n1++ <<" --> Data Type Who Knows \n Data Type "
    << typeid(value).name() << " Value assigned : " << (value);
    }

  • No generic key word with MinGW compiler. ( Exclusive for Visual Studio with Net Framework)
  • Code : myTemplateFunct3.txt

Step: 1 Create a project

Step: 2 Create a source file

Step: 3 Edit Source code ( compare with myTemplateFunct2.htm )

Step: 4 Runtime View

Step: 5