hai
  when iam executing the following code
  there is a compiler error showing in the line mentioned below (bolded line)
  the error is `template<class T> struct sum' used without template parameters 
  what exactly is this and how can i sort this
  please help me
  praveen
   
  #include <iostream>
#include <conio.h>
  using namespace std;
  template <class T> void foo(T op1, T op2) {
         std::cout << "op1 = " << op1 << std::endl;
         std::cout << "op2 = " << op2 << std::endl; 
}
  template <class T> 
struct sum {
       static void foo(T op1, T op2)
       {
               std::cout << "sum = " << op2 << std::endl;
       }
};
       
  int main() 
{ 
    foo(1,3);
    foo<int>(1,'3');
    sum::foo(1,2);  // Error in this line
    
    getch();
    return 0; 
} 


       
---------------------------------
 From Chandigarh to Chennai - find friends all over India.  Click here.

[Non-text portions of this message have been removed]

Reply via email to