View unanswered posts | View active topics It is currently Fri Oct 24, 2014 10:57 am






Reply to topic  [ 10 posts ] 
Robot C vs C 
Author Message
Rookie

Joined: Fri Oct 21, 2011 11:04 pm
Posts: 3
Post Robot C vs C
I'm familiar with C and just joined my school's robotics club...and Robot C is kinda odd. Can you use all of C's features in Robot C? (enums, casting, etc) What is Robot C? Is it only loosely based on C or is it C with some library? Basically, what are the differences between Robot C and C?


Fri Oct 21, 2011 11:12 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Robot C vs C
No, RobotC is not standard ANSI C. It is a hybrid between C and C++ with a lot of standard features missing. To name a few, it doesn't allow a function to be re-enter, so no recursion and it doesn't support pointers either.


Sat Oct 22, 2011 2:02 am
Profile
Rookie

Joined: Fri Oct 21, 2011 11:04 pm
Posts: 3
Post Re: Robot C vs C
Thanks. Is there a document that lists all of the differences between RobotC and C or some sort of "Tutorial for C Programmers?"


Sat Oct 22, 2011 9:00 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Robot C vs C
No, I don't have a document. But there are a lot of posts on this subject. You may want to search for them.


Sat Oct 22, 2011 9:05 pm
Profile
Rookie

Joined: Fri Oct 21, 2011 11:04 pm
Posts: 3
Post Re: Robot C vs C
That's what I've been doing, wanted to know if there's documentation on this so I know I'm not wasting my time with searches. Side note: How do you concentrate a string and int in RobotC?


Sat Oct 22, 2011 9:20 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Robot C vs C
I haven't tried it myself but it looks like RobotC supports sprintf.


Sun Oct 23, 2011 12:05 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post Re: Robot C vs C
If you go to Window > Menu Level and select Expert, the Function Library will grow to show the "Strings" category, which does include sprintf.

One of our current projects is compiling all available commands in ROBOTC into a single document. We're hoping to share that relatively soon. In the mean time, quite a bit is documented here: http://www.robotc.net/support/vex/WebHelpCortex/

and tutorials for beginners can be found here: http://www.education.rec.ri.cmu.edu/pro ... index.html

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Mon Oct 24, 2011 10:07 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Robot C vs C
jbflot wrote:
One of our current projects is compiling all available commands in ROBOTC into a single document. We're hoping to share that relatively soon. In the mean time, quite a bit is documented here: http://www.robotc.net/support/vex/WebHelpCortex/

I assume this document only covers all the RobotC provided functions but not about listing the differences between RobotC and ANSI C which was the original question from jaymc.


Mon Oct 24, 2011 1:51 pm
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post Re: Robot C vs C
Actually we're hoping to do both. The ROBOTC functions portion is a higher priority, but a comparison piece will come after.

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Mon Oct 24, 2011 2:22 pm
Profile
Rookie

Joined: Thu Dec 29, 2011 8:34 pm
Posts: 14
Post Re: Robot C vs C
The question of how to "concentrate" strings, which I assume means concatenate, is interesting. I stumbled on a document that says RobotC has many nifty string methods:

http://carrot.whitman.edu/Robots/NXT/Strings.htm

It says you can concatenate two strings with the "+" operator:

Code:
string3 = string1 + string2; //  concatenate strings
It also says that assigning an int to a string formats the integer to represent it as a string:
Code:
string s1;
string s2;
int n1 = 42;

s1 = n1;  // s1 is "42"
s2 = "The Answer is ";
s2 += n1;  // "The Answer is 42"
Pretty slick! I did not verify this, I'm just summarizing the doc at the URL above!


Sat Jan 07, 2012 12:53 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 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.