c++ - Error: Use of class template requires template argument list -
When I try to run my program, this error "C2955 error:" Fourth "shows: Class templates Use template logic is required for the list "
#include & lt; Iostream & gt; using namespace std; Template & lt; Square t, int n & gt; Class IV {Private: TA [N]; Public: Zero ReadData (); Zero performance data (); }; Around :: Zero: ReadData () {for (int i = 0; i & lt; n; ++ i) cin & gt; One. [I]; } Zero four :: performance data (for (int i = 0; i Do I have a template To type again?
The members of the template class itself are the owner of the template class. When such a member is defined outside of his or her class, then it should be clearly declared as a template.
So you need a change.
minus four :: ReadData () to
template n>: ReadData () and DisplayData function. and some other errors are:
ReadData , change cin> in the function & Gt; A. [I]; to
cin> & Gt; A [i]; and DisplayData , cin & gt; & Gt; A. [I] & lt; & Lt; '\ T'; to
cout & lt; & Lt; A [i] & lt; & Lt; '\ T';
Comments
Post a Comment