Author |
Message |
jaymc
Rookie
Joined: Fri Oct 21, 2011 11:04 pm Posts: 3
|
 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 |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 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 |
|
 |
jaymc
Rookie
Joined: Fri Oct 21, 2011 11:04 pm Posts: 3
|
 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 |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 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 |
|
 |
jaymc
Rookie
Joined: Fri Oct 21, 2011 11:04 pm Posts: 3
|
 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 |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 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 |
|
 |
jbflot
Site Admin
Joined: Tue May 15, 2007 9:02 am Posts: 409
|
 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
|
Mon Oct 24, 2011 10:07 am |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Robot C vs C
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 |
|
 |
jbflot
Site Admin
Joined: Tue May 15, 2007 9:02 am Posts: 409
|
 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.
|
Mon Oct 24, 2011 2:22 pm |
|
 |
gnormhurst
Rookie
Joined: Thu Dec 29, 2011 8:34 pm Posts: 14
|
 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.htmIt says you can concatenate two strings with the "+" operator: It also says that assigning an int to a string formats the integer to represent it as a string: Pretty slick! I did not verify this, I'm just summarizing the doc at the URL above!
|
Sat Jan 07, 2012 12:53 am |
|
|