Is there a C++ style operator overloading that enables '+' for concatenation of strings? It seems this should work from what I found here - http://carrot.whitman.edu/Robots/NXT/Strings.htmhy would this be an issue with the current 3.62 out of the box?

OK Thanks Ernest - could you point me to the documentation on the native String support? Could not find it in the docs etc other than Whitman site.

Mon Oct 28, 2013 9:50 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Sample Errata?

You mean you don't get this?

Attachments:

Capture.JPG [ 41.56 KiB | Viewed 4050 times ]

Mon Oct 28, 2013 9:58 pm

TheKog

Rookie

Joined: Fri Oct 25, 2013 11:34 amPosts: 8

Re: Sample Errata?

I got that, but where is the description for the String data type, the operators, and extension to the language. Those are merely functions that operate on strings. Generally where is THE the language definition for RobotC? Not the function library but the language.

Mon Oct 28, 2013 10:07 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Sample Errata?

To be honest with you, I don't use the "string" data type in RobotC. I think it has a limit of storing only 19 characters. I am not 100% sure. I haven't played with string for a long time, but that was the impression I got when I played with it long time ago. It seems pretty useless to me. Since 3.x now supports pointers, I use char array (and char *) instead. Having said that, char array also has a limit of about 220 characters. I have already filed a bug against it because I ran into that limitation when writing a program that requires long strings.

Mon Oct 28, 2013 10:20 pm

TheKog

Rookie

Joined: Fri Oct 25, 2013 11:34 amPosts: 8

Re: Sample Errata?

Yes that is how it would be done in "real" C Is it strict on data typing? For example if a function expects a "String" type can you pass it something declared "char *" - does RobotC allow "casting" etc?

Tue Oct 29, 2013 8:05 am

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Sample Errata?

TheKog wrote:

Yes that is how it would be done in "real" C Is it strict on data typing? For example if a function expects a "String" type can you pass it something declared "char *" - does RobotC allow "casting" etc?

If you are talking about the supported string related functions such as strcpy, strcat ... etc, they supported both "string" and "char *" types. For example, take a look at the file c:\Program Files (x86)\Robomatter Inc\ROBOTC Development Environment\Includes\RobotCIntrinsics.c

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum