-
November 2nd, 2009, 04:52 PM
#1
Unfamiliar compiler message
I'm trying to add some ADTs to corresponding vectors and test my toString() function. When I build the project, I get the compiler message --
Code:
1>c:\users\sterling\documents\visual studio 2008\projects\building\building\building.cpp(54) : error C2664: 'void Bathroom::addShower(Shower)' : cannot convert parameter 1 from 'Shower (__cdecl *)(void)' to 'Shower'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
That is just the first message for room.addShower(one);
I get a message for each attempt to add.
My main code is just
Code:
Bathroom room;
Shower one();
Shower two();
Stall three();
Stall four();
Stall five();
Mirror six();
Sink seven();
room.addShower(one);
room.addShower(two);
room.addStall(three);
room.addStall(four);
room.addStall(five);
room.addMirror(six);
room.addSink(seven);
cout<<room.toString();
I'm pretty lost when I read the compiler message, what is it trying to tell me?
-
November 2nd, 2009, 04:56 PM
#2
Re: Unfamiliar compiler message
Nevermind, the () after Shower one, Shower two, etc was the problem.
-
November 3rd, 2009, 08:22 AM
#3
Re: Unfamiliar compiler message
Just to reiterate what happened - the () makes it a forward declaration: not a variable declaration.
Succinct is verbose for terse
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|