View unanswered posts | View active topics It is currently Sat Oct 25, 2014 12:57 pm






Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
is it possible to forward declare a struct 
Author Message
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: is it possible to forward declare a struct
[OT:]
I think a sort of perma-link to the latest update would be fine for all us beta developers, working for nothing...
[/OT]
:wink:

_________________
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)}


Sat Aug 16, 2008 2:25 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: is it possible to forward declare a struct
Ford Prefect wrote:
[OT:]
I think a sort of perma-link to the latest update would be fine for all us beta developers, working for nothing...
[/OT]
:wink:

My guess is that Dick and the other developers wake up in a sweat every morning, wondering if you've created yet another piece of code that kills the compiler!

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Aug 16, 2008 3:15 pm
Profile WWW
Expert

Joined: Sun Aug 19, 2007 2:43 pm
Posts: 138
Location: New Jersey
Post Re: is it possible to forward declare a struct
RobotC has come a long way since the 1.0 version. I am just grateful that I have RobotC to work with. Of course, it has its down side, but the upside surpass the down side..... Small footprint, very very low cost, no big complaint. At least, not like some other software I have used, a newer version broke something else. Then, refixing it ends up unfix something else!!!

back to the pointer/structure issue: it will be great also include more standard C pointer to structure access...

e.g.
Code:
void MoveFinger(mySTRUCT &f)
{
    ....
    f->elements...

    instead of this, in 1.4, it requires:

    f.elements...
    ....
}


Sat Aug 16, 2008 3:39 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: is it possible to forward declare a struct
elizabeth.mabrey wrote:
it will be great also include more standard C pointer to structure access...

I agree to this - above all if it included more standard C altogether :wink:

But back to the pointers:
Pointers on the whole only would work like in standard C, if there was a heap to allocate dynamic memory by pointers.
Cause this ain't possible because of the Lego memory design ( if I understood Dick correctly), this unfortunately will never happen.
On the other hand, some features of C++ are included in RobotC (e.g., structures, function call by reference, overloading of functions), which don't have their place in ANSI C (C99), whereas related ANSI C features and many other things (e.g., 7-dimensional arrays, pointers as function parameters, standard I/O, libraries, recursive functions...) are completely missing.
This unfortunately leads to sort of unsystematical appearance.

_________________
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)}


Sat Aug 16, 2008 3:48 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 19 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: hexafraction 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.