View unanswered posts | View active topics It is currently Mon Sep 21, 2020 3:19 pm






Reply to topic  [ 3 posts ] 
C vs. RobotC 
Author Message
Rookie

Joined: Thu Oct 08, 2009 3:28 pm
Posts: 7
Post C vs. RobotC
Hi! :D

I'm rather new to NXT, RobotC, etc. (but I know C and Java) I was trying out RobotC and I noticed that there are not too subtle differences between the C and the RobotC languages. On one hand, it has native support for things C doesn't have (such as booleans), but on the other, it is missing vital features such as pointers, structs, etc.

I would greatly appreciate it if someone could give me a primer on the differences between C and RobotC. Thank you in advance!! :D


Thu Oct 08, 2009 8:06 pm
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: C vs. ROBOTC
hi,
First I have to defend RobotC: structs they do have, maybe the syntax is different ?
Code:
typedef struct{
   float f;   
   int i;
   string s;
} tfoo;


but with the rest you're absolutely right.
so, a very short primer for you mightbe:

C is C and RobotC is not C :D

there are no pointers and never will be - use the forum's search ("ANSI C"), maybe you'll find some other issues

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Fri Oct 09, 2009 1:56 pm
Profile
Rookie

Joined: Thu Oct 08, 2009 3:28 pm
Posts: 7
Post Re: C vs. ROBOTC
Code:
typedef struct{
   float f;   
   int i;
   string s;
} tfoo;


Ahh, you might be right... I was using:

Code:
typedef struct foo{

} foo;


So I guess it doesn't have full support for structs but does have some ;)


Sat Oct 10, 2009 1:02 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.