Welcome to Dream.In.Code
Become a C++ Expert!

Join 150,068 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,809 people online right now. Registration is fast and FREE... Join Now!




problem with a constructor

 
Reply to this topicStart new topic

problem with a constructor

c--
1 Feb, 2008 - 09:05 PM
Post #1

New D.I.C Head
*

Joined: 26 Jan, 2008
Posts: 27

I'm getting errors when I try using this contructor for a game:

CODE

juego::juego(){

        //randomiza
        iniciar.randomize();

        cout << "Type the number of the box you think has the star: ";
        //Obtiene
        Get.obtiene();
    }



Error 5 error C2143: syntax error : missing ';' before '{' c:\Documents and Settings\Luis Cruz\My Documents\Visual Studio 2008\Projects\game\game\game.cpp 62

Error 6 error C2660: 'juego::obtiene' : function does not take 0 arguments c:\Documents and Settings\Luis Cruz\My Documents\Visual Studio 2008\Projects\game\game\game.cpp 69


Does someone knows what's going on??

User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Problem With A Constructor
1 Feb, 2008 - 09:22 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,660



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
The first error has something to do with missing a curly brace or not ending a line with a semicolon... but not in the code you are showing. Start checking the code above this code. Which line is line 62? Then give us the first several lines above your constructor.

The second error is because you have defined obtiene method to take parameters and since you are not supplying any when you call, it throws that error.

So in short we will need to see more than the constructor. smile.gif
User is online!Profile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 10:54PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month