I have this relatively easy asignment for school (only thing is that "tutorials" for C++ on the internet are TOO DAMN COMPLICATED so I bearly understand a thing :|)
I get the errors
because of the "gets(NAME_EXP);" thing but I need to use it to put something like "bla bla text with spaces" because string normally doesn't accept spacesCode:In member function `PACKAGE DATE_EXP<PACKAGE>::INSERT_DATE_EXP() [with PACKAGE = char]': instantiated from here invalid conversion from `char' to `char*' initializing argument 1 of `char* gets(char*)'
Code:template <class PACKAGE> class DATE_EXP{ PACKAGE NAME_EXP ,ADRESS_EXP ; public: DATE_EXP(PACKAGE first,PACKAGE second){NAME_EXP=first,ADRESS_EXP=second;} PACKAGE INSERT_DATE_EXP (); }; //class DATE_EXP template <class PACKAGE> PACKAGE DATE_EXP<PACKAGE>::INSERT_DATE_EXP (){ gets(NAME_EXP); gets(ADRESS_EXP); cout<<"NAME_EXP IS "<<NAME_EXP<<"\n"; cout<<"ADRESS_EXP IS "<<ADRESS_EXP<<"\n"; main(){ char NAME_EXP_TEMP,ADRESS_EXP_TEMP; DATE_EXP<char>EXP_TEMP(NAME_EXP_TEMP,ADRESS_EXP_TEMP); cout<<EXP_TEMP.INSERT_DATE_EXP(); }



LinkBack URL
About LinkBacks



