View unanswered posts | View active topics It is currently Sun Dec 28, 2014 12:02 pm






Reply to topic  [ 4 posts ] 
robotc/c 
Author Message
Rookie

Joined: Fri Jul 20, 2007 11:38 am
Posts: 3
Post 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
Profile
Rookie

Joined: Sat Jun 16, 2007 6:24 pm
Posts: 14
Post 
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
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
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
Profile WWW
Rookie

Joined: Fri Jul 20, 2007 11:38 am
Posts: 3
Post 
Thank you for your replies.


Sun Jul 22, 2007 12:47 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 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

Search for:
Jump to:  



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