View Single Post
  #10   Spotlight this post!  
Unread 25-01-2008, 12:56
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,112
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: Does reading from the serial port work?

Whoa, this is a lot weirder than I expected.

Is there some "magic" involved in this line?
Code:
for ( x = byteswaiting ; byteswaiting == x ; x++ )
Its purpose is not at all obvious. Regardless of the value of byteswaiting, the code in braces following the line will be executed exactly once. The variable x appears to have no function inside the braces. I'll do it that way, but I have to assume there's something happening behind the scenes that isn't being explained.

I was always told that the %d format specifier expects an int variable, and that you had to cast chars with (int) in order to avoid problems. Is this not the case with EasyC's PrintToScreen() function?

I'm also confused by the fact that you've named the function main(). I thought that name was already taken. Is this another "magic" feature of EasyC that does something undocumented, or am I completely misunderstanding what's going on here?