View unanswered posts | View active topics It is currently Sat Apr 19, 2014 10:33 am






Reply to topic  [ 3 posts ] 
list of what all the punctuations do! 
Author Message
Rookie

Joined: Sun Jun 09, 2013 2:26 am
Posts: 1
Post list of what all the punctuations do!
Hi, i'm trying to make a quick little guide for my fellow student engineers in our robotics class and i was wondering if anyone could provide or write down what are all the punctuations robotc uses and what do they do. It would also be awesome if you could also list the commands that would usually go with them. Thanks a bundle!!! :bigthumb:


Sun Jun 09, 2013 2:31 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: list of what all the punctuations do!
What do you mean by punctuations? This?
, is used to separate arguments: nxtSetPixel(xPos, yPos);
. is to denote a member of a struct: triangle.side
" is used to mark something as a literal string: string greeting = "hello";
; marks the end of an instruction
' is used for literal characters: char foo = 'c';
# is used for precompiler pragmas: #include "helperfile.h" (note, they do not have a ";" at the end of the line)
% calculates the modulo, or remainder of a division: 4 % 3 = 1
^ is exclusive or (XOR)
& is and (AND)
* is multiplication
( and ) are simple brackets for changing the order in which things are evaluated
- and + should be obvious
| is or (OR)
: and ? are used in conditional assignments (may be a bit too complex)
~ is binary inversion

There's quite a few more: check out http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B for details :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Jun 09, 2013 2:56 am
Profile WWW
Rookie

Joined: Sat Jun 15, 2013 7:00 am
Posts: 12
Post Re: list of what all the punctuations do!
Thanks Xander,

Your posts are always helpful.


Sun Jun 23, 2013 5:37 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.