On Wed, 25 Jun 2003 17:31:19 GMT, "Tim Mierzejewski"
<> wrote in comp.lang.c++:
> Could someone look through this code and tell me why I'm getting this error?
> I'm only including the important code here. There's more obviously, but this
> should be enough to solve the problem.
>
> #include "Creature.hpp" // This defines the class Creature.
> void Minotaur(Creature *Player);
>
> int CreatureSelection;
> cin >> CreatureSelection;
> Creature *Play1 = new Creature
> switch (CreatureSelection)
> {
> case (1):
> Minotaur(*Play1); // Line #33
Remove the asterisk in *Play1. Play1 is already a pointer to
Creature. *Play1 would be the Creature object itself, not the
pointer.
> }
> return 0;
>
> void Minotaur(Creature *Player)
> {
> Player->SetValues(50, 20, 9, 4, false, 0, false, false, false, false,
> false) // Calls a function within Creature.hpp.
> }
>
>
> ----
> C:\......FileName.cpp(33): error C2664: 'Minotaur' : cannot convert
> parameter 1 from 'class Creature' to 'class Creature *'
> No user-defined-conversion operator available that can perform this
> conversion, or the operator cannot be called
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
ftp://snurse-l.org/pub/acllc-c++/faq