|
Page 1 of 1
|
[ 4 posts ] |
|
Author |
Message |
murali.koppula
Rookie
Joined: Fri Jul 20, 2007 11:38 am Posts: 3
|
 robotc/c
Does robotc support regular C?
I tried compiling a simple c program:
void main () {}
or
#include <stdio.h>
main () {printf ("Hello World");
I get errors.
What is the difference between regular C and RobotC programming ?
If it is different, where can can I get a guide for learning RobotC ?
Thanks,
Murali.
|
Sat Jul 21, 2007 8:37 am |
|
 |
dtrotzjr
Rookie
Joined: Sat Jun 16, 2007 6:24 pm Posts: 14
|
Syntactically RobotC is a lot like C. It has many keywords in common with C and the programs are structured much like C. RobotC however is not C.
To get a good idea of how to write RobotC apps, open the Sample programs and read them. There is also some documentation that comes with RobotC explaining the API.
I hope this helps!
-- David Trotz
|
Sat Jul 21, 2007 5:43 pm |
|
 |
starwarslegokid
Moderator
Joined: Wed Jan 31, 2007 3:39 am Posts: 299 Location: San Diego, California. USA
|
Dtrotzjr made a great point, the sample programs help alot in seeing the similarities and differences between Robot C and C
As far as the three sample bits you showed, Robot C uses
task main()
{
}
when initializing a program
When including a file, you have to bracket the filename in "" instead of <>
Also if you want to print text or variables to a screen, you have to use Robot C exclusive commands. One way to find these commands is to double click on a category in the Code Templates Toolbar on the left part of the screen and it will bring up Robot C exclusive commands to activate special functions of your NXT or RCX.
Good Luck
Scott
_________________Mmmm Legos B-) My Robot Projects: http://www.freewebs.com/robotprojects/
|
Sat Jul 21, 2007 9:02 pm |
|
 |
murali.koppula
Rookie
Joined: Fri Jul 20, 2007 11:38 am Posts: 3
|
Thank you for your replies.
|
Sun Jul 22, 2007 12:47 am |
|
|
|
Page 1 of 1
|
[ 4 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
|
|