Go to Post Unfortunately, you cannot always tell when some things are jokes on forums, because we only can rely on text and a limited number of smilies. - artdutra04 [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 30-01-2015, 17:25
catacon catacon is offline
Registered User
FRC #1444 (Lightning Lancers)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2006
Location: St. Louis
Posts: 154
catacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to behold
Re: C++ Errors

Quote:
Originally Posted by pntbll1313 View Post
Sorry if this is dumb (I'm not a C++ guy), but do you need a semicolon after your robot definition?

Robot() :
talon(1),jaguar(2)
{
}

I'm unclear if this is your entire code, a section that you think is giving the error, or you've removed some of the code. Posting the errors you get will probably help smarter programmers than I
This is correct. He is using an initialization list to initialize the Talon and Jaguar members.

OP, since you gave us no information on what errors you are encountering, it's near impossible for us to give you any useful advice. However, I'm going to guess you didn't rebuild the index for a new project. Try that and see if it fixes your errors (whatever they may be). Let's see if my crystal ball still works....

Code:
        class Robot : public SampleRobot
        {
            private:
                Talon talon;
                Jaguar jaguar;
            public:
                Robot() :
                    talon(1),
                    jaguar(2)
                {

                }

            void Autonomous()
            {
                Wait(2.0);
            }
            void OperatorControl()
            {
                while (IsOperatorControl() && IsEnabled())
                {
                    talon.Set(1);
                    Wait(1.0);
                }
            }
        };

Last edited by catacon : 30-01-2015 at 17:30.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2015, 17:27
FRC2501's Avatar
FRC2501 FRC2501 is offline
Registered User
FRC #2501 (Bionic Poalrs)
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Minnesota
Posts: 52
FRC2501 is an unknown quantity at this point
Re: C++ Errors

Quote:
Originally Posted by catacon View Post
This is correct. He is using an initialization list to initialize the Talon and Jaguar members.

OP, since you gave us no information on what errors you are encountering, it's near impossible for us to give you any useful advice. However, I'm going to guess you didn't rebuild the index for a new project. Try that and see if it fixes your errors (whatever they may be). Let's see if my crystal ball still works....
Sorry, (never let a freshman post for you)
I fixed this by making a new project (apparently it doesn't like that project name)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:03.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi