C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

probleme de constructeur surchargé avec parametre par defaut

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French)
View previous topic :: View next topic  
Author Message
xavier
Guest





PostPosted: Tue Jan 25, 2005 12:16 pm    Post subject: Re: probleme de constructeur surchargé avec parametre par de Reply with quote



dark poulpo a dit le 25/01/2005 13:24:
Quote:
merci de me dire ou je me trompe!!!

Tu te trompes dans l'emplacement des valeurs par défaut :

CTe {
public:
CTe(char *, int = 0, int = 0);
};

CTe::CTe(char * label, int f, int g) {
}

Et je te conseille d'utiliser "std::string const &" au lieu de "char *".

xavier

Back to top
dark poulpo
Guest





PostPosted: Tue Jan 25, 2005 12:24 pm    Post subject: probleme de constructeur surchargé avec parametre par defaut Reply with quote



salut,
voila

jai une classe

class CTe {
public:
....
CTe();
CTe(char *,int,int);
virtual ~CTexture();
};

CTe::CTe(char *label,int f=0,int g=0)
{
...
}

CTe::CTe()
{
...
}

....


seulement voila, si je fait:

CTe spl_top("data\top.ddt");

jai un erreur :

system.cpp(426) : error C2664: '__thiscall CTe::CTe(const class CTe &)' :
cannot convert parameter 1 from 'char [20]' to 'const class CTe &'
Reason: cannot convert from 'char [20]' to 'const class CTe'
No constructor could take the source type, or constructor overload
resolution was ambiguous



merci de me dire ou je me trompe!!!

--
-----
http://dark.freezee.org/
- Dark Update v1.0
- Dark Emule v0.44b r4
- Dark 3D-X (le desktop 3d pour windows) (en cours)


Back to top
dark poulpo
Guest





PostPosted: Tue Jan 25, 2005 12:26 pm    Post subject: Re: probleme de constructeur surchargé avec parametre par de Reply with quote



Quote:
virtual ~CTexture();

ne le comptez pas comme l'erreur, il ny ai pas dans cette classe



Back to top
Fabien LE LEZ
Guest





PostPosted: Tue Jan 25, 2005 9:03 pm    Post subject: Re: probleme de constructeur surchargé avec parametre par de Reply with quote

On Tue, 25 Jan 2005 13:24:46 +0100, "dark poulpo" <qsdqd (AT) sss (DOT) ss>:

Quote:
CTe(char *,int,int);

char const*



--
;-)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.