a_Burhan Posted March 23, 2009 Share Posted March 23, 2009 i'm work on visual studio 2003 and i have got this error please help me to solve it c:\Documents and Settings\A.Burhan\My Documents\Visual Studio Projects\uni4\Std.cpp(12): error C2664: 'Cou::Cou(const Cou &)' : cannot convert parameter 1 from 'std::string' to 'const Cou &' Cou is a class and the error on constructor Std::Std(std::string Cn,std::string Pn,std::string Sn,int num) :CC(Cn), PP(Pn) { name = Sn; number= num; } Link to comment Share on other sites More sharing options...
0 a_Burhan Posted March 23, 2009 Author Share Posted March 23, 2009 anyone please !! :) Link to comment Share on other sites More sharing options...
0 ViZioN Posted March 23, 2009 Share Posted March 23, 2009 In your class what is name defined as? If it's a string don't you have to do strcpy(name, Sn); ? Link to comment Share on other sites More sharing options...
0 a_Burhan Posted March 25, 2009 Author Share Posted March 25, 2009 thanks man i solve the problem Link to comment Share on other sites More sharing options...
0 ViZioN Posted March 25, 2009 Share Posted March 25, 2009 You're welcome :) Link to comment Share on other sites More sharing options...
0 vks87 Posted April 3, 2009 Share Posted April 3, 2009 I wanted to help you but i saw your problem is sorted out so good luck and have a nice time.. Link to comment Share on other sites More sharing options...
Question
a_Burhan
i'm work on visual studio 2003
and i have got this error
please help me to solve it
c:\Documents and Settings\A.Burhan\My Documents\Visual Studio Projects\uni4\Std.cpp(12): error C2664: 'Cou::Cou(const Cou &)' : cannot convert parameter 1 from 'std::string' to 'const Cou &'
Cou is a class
and the error on constructor
Std::Std(std::string Cn,std::string Pn,std::string Sn,int num)
:CC(Cn), PP(Pn)
{
name = Sn;
number= num;
}
Link to comment
Share on other sites
5 answers to this question
Recommended Posts