Go to Post Woody says that gracious professionalism is "acting how you would if you grandmother was watching you"... some people must have some really crazy grandmothers. (: - Cappeh [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-01-2007, 15:57
brainonska's Avatar
brainonska brainonska is offline
Registered User
AKA: Magical Steve
FRC #1155 (Sciborgs)
Team Role: Programmer
 
Join Date: Apr 2006
Rookie Year: 2006
Location: New York City
Posts: 19
brainonska is an unknown quantity at this point
Send a message via AIM to brainonska
Re: hey, stupid question but...

i could be wrong...

but you declared the integer variable "max" in the function.

try putting "int max;" in your first line of code along with all your other variable declarations and then in the function... "max = ..."
__________________
Real programmers don't comment their code:
it was hard to write... it should be hard to understand
  #2   Spotlight this post!  
Unread 20-01-2007, 17:09
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: hey, stupid question but...

Quote:
Originally Posted by brainonska View Post
i could be wrong...

but you declared the integer variable "max" in the function.

try putting "int max;" in your first line of code along with all your other variable declarations and then in the function... "max = ..."
All that would do is make it global, and the error would be different for that. I'm with Mike and the gang, I say it's an error in a previous line, or it doesn't like using int in the function name.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #3   Spotlight this post!  
Unread 20-01-2007, 21:07
brainonska's Avatar
brainonska brainonska is offline
Registered User
AKA: Magical Steve
FRC #1155 (Sciborgs)
Team Role: Programmer
 
Join Date: Apr 2006
Rookie Year: 2006
Location: New York City
Posts: 19
brainonska is an unknown quantity at this point
Send a message via AIM to brainonska
Re: hey, stupid question but...

Quote:
Originally Posted by Matt Krass View Post
All that would do is make it global, and the error would be different for that. I'm with Mike and the gang, I say it's an error in a previous line, or it doesn't like using int in the function name.
thats true if the variable is only used in a function-level scope
but ive made the mistake of using function-level variable outside the function.

Its probably not the problem, but its worth a try.
__________________
Real programmers don't comment their code:
it was hard to write... it should be hard to understand
  #4   Spotlight this post!  
Unread 20-01-2007, 23:56
TheOtherGuy's Avatar
TheOtherGuy TheOtherGuy is offline
Unregistered User
AKA: Kevin Forbes
FRC #4183 (Bit Buckets)
Team Role: Engineer
 
Join Date: Jul 2006
Rookie Year: 2006
Location: Tucson, AZ
Posts: 408
TheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond repute
Re: hey, stupid question but...

it probably isn't prototyping since it is a syntax error. My guess is that it sometimes tells you there's an error a line or two after the actual error. It may be a problem with the int intmax(int x, int y) line. try changing a couple things to see if that's the problem.
__________________
  #5   Spotlight this post!  
Unread 24-01-2007, 17:49
Phantomechanics's Avatar
Phantomechanics Phantomechanics is offline
phantom mechanics
AKA: joey
FRC #2028
Team Role: Student
 
Join Date: Jan 2007
Rookie Year: 2007
Location: hampton VA
Posts: 7
Phantomechanics is an unknown quantity at this point
Send a message via AIM to Phantomechanics
Re: hey, stupid question but...

Hey you who had the problem, are you still with us?
Why do you even have 'max'? Couldnt you just use this?
Code:
int intMax(int x, int y)
{                                //here is where I get the syntax error
    if(y > x)
        x = y;
    
    return x;
}
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid Variable question.... BillyJ Programming 3 20-02-2006 19:49
Stupid question but... Adam Y. Math and Science 6 16-02-2004 19:29
Really stupid question psychoCHIPMUNKK Kit & Additional Hardware 3 15-02-2004 00:26
stupid question x10 Tom Bottiglieri CD Forum Support 1 04-02-2004 22:40
ill probably feel stupid but i do anyway so... Anthony Kesich Programming 8 05-11-2003 12:53


All times are GMT -5. The time now is 04:15.

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