Recently i got stuck in the templates , i passed a dummy argument in the template but this isn't working and gives compilation error here is my code..
#include <iostream>
using namespace std;
template<typename T>
class A{
private:
T b;
public:
A()
{
cout<<"1st is executing "<<endl;
}
};
template<typename T,int>
class A{
private:
T b;
public:
A(){
cout<<"2nd is executing "<<endl;
}
};
int main(){
A<string> a;
A<string,100> b;
}
In my point of view it should work fine but it gives re declaration error and I dn't know why .....plz Help THANKS