Go to Post You know you've overdosed on FIRST when you hear people yell "CHARGE" and you get confused and lost when you look and see baseball and not robots - thatphotochick [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 24-01-2008, 13:19
jonboy jonboy is offline
Engineer/Mentor
FRC #0885 (The Green Team)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Tunbridge, Vermont
Posts: 46
jonboy is an unknown quantity at this point
EasyC Assignment rules

Question is where can I get the assignment rules when using mixed types in an assignment expression. Does ANSI C apply? TNX
__________________
... jon
  #2   Spotlight this post!  
Unread 24-01-2008, 13:22
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: EasyC Assignment rules

Can you please explain a little bit further as to what you are referencing, and perhaps what you are trying to do?

We'd love to help! Just need more info.

Jacob
  #3   Spotlight this post!  
Unread 24-01-2008, 16:45
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: EasyC Assignment rules

The place where Microchip C diverges significantly from ANSI C is exactly what jonboy was asking about.

What you need to know is this: the compiler looks at the size of the operands when choosing the precision of the operator, and picks the smallest number of bits that will fit both operands. It doesn't care about the size of what you're storing the result in. If you're adding or multiplying two chars, the answer will be a char and overflow will be an issue. The typical workaround is to cast one of the operands as (int) in order to force the compiler to do 16-bit arithmetic instead of just 8.
  #4   Spotlight this post!  
Unread 27-01-2008, 11:07
jonboy jonboy is offline
Engineer/Mentor
FRC #0885 (The Green Team)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Tunbridge, Vermont
Posts: 46
jonboy is an unknown quantity at this point
Re: EasyC Assignment rules

Alan:

TNX for the reply. You hit the nail on the head. I was hoping the EasyC expert on the board would have the definitive answer. Not a big deal, but it would remove some of the mystery sooner and with greater ease.
TNX agn
__________________
... jon
  #5   Spotlight this post!  
Unread 28-01-2008, 16:36
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: EasyC Assignment rules

If you are looking for the sizes open the help file click on "Index" and type/paste
"Variable definitions table"
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
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
MS Vista/EasyC & EasyC Pro rswsmay Programming 1 25-04-2007 10:47
Help on a Homework Assignment. Pavan Dave General Forum 1 13-09-2006 14:20
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12
Student assignment at Championship Andrew Schuetze Team Organization 7 07-04-2005 23:24


All times are GMT -5. The time now is 23:17.

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