![]() |
| | #1 |
| "Why use dynamic memory?" Join Date: Aug 2006
Posts: 179
| what is wrong? Player class includes <vector> Human class includes Player In the human class i define a function, which is not defined in Player class (this is just a function related to Human class alone... it has nothing to do with Player): Code: int bet(vector<int>& availableBets, HINSTANCE hinstance); Code: int Human::bet(vector<int>& availableBets, HINSTANCE hinstance)
{
//this function should pop up a modal dialog box
//so that the player can choose his bet
//get handles to all of the buttons to disable
//some if needed
_bet = (int)DialogBox(hinstance, //application instance
MAKEINTRESOURCE(IDD_ChooseBet), //style
0, //parent
(DLGPROC)ChooseBetProc //dialog procedure
);
}
error C2061: syntax error : identifier 'vector' error C2062: type 'int' unexpected error C2143: syntax error : missing ';' before '{' error C2447: '{' : missing function header (old-style formal list?) what is wrong?
__________________ "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."-Bjarne Stroustrup OS: Microsoft XP Media Center IDE: Microsoft Visual Studio 2005 pro edition Current Porject: Developing a 2D card game... Last edited by Hussain Hani; 07-10-2009 at 01:00 AM. |
| Hussain Hani is offline | |
| | #2 |
| C++0x User Join Date: Nov 2008 Location: Sweden
Posts: 133
| Try std::vector |
| Tux0r is offline | |
| | #3 |
| "Why use dynamic memory?" Join Date: Aug 2006
Posts: 179
| it worked!!! strange :S because in Player class, it has a function that takes a vector reference without an std!! thnx
__________________ "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."-Bjarne Stroustrup OS: Microsoft XP Media Center IDE: Microsoft Visual Studio 2005 pro edition Current Porject: Developing a 2D card game... |
| Hussain Hani is offline | |
| | #4 |
| C++0x User Join Date: Nov 2008 Location: Sweden
Posts: 133
| Perhaps you were "using namespace std;" in player.cpp but not in human.cpp, either way I like to always explicitly state std:: |
| Tux0r is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with input choice... Somethings wrong... really wrong.... | greenferoz | C++ Programming | 9 | 07-15-2004 03:30 PM |
| Debugging-Looking in the wrong places | JaWiB | A Brief History of Cprogramming.com | 1 | 11-03-2003 10:50 PM |
| Confused: What is wrong with void?? | Machewy | C++ Programming | 19 | 04-15-2003 12:40 PM |
| God | datainjector | A Brief History of Cprogramming.com | 746 | 12-22-2002 12:01 PM |
| Whats wrong? | Unregistered | C Programming | 6 | 07-14-2002 01:04 PM |