String Construct in NXC
String Construct in NXC
Is there a way of combining text strings in NXC (like the NXT-G "Text" block)? I have tried searching here for it, but I cannot find it.
-
- Posts: 224
- Joined: 30 Oct 2010, 04:10
- Location: 127.0.0.1
- Contact:
Re: String Construct in NXC
StrCat("abc","123");
?
yay for inline
codetags
"["c"]" "["/c"]"Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Re: String Construct in NXC
Or, you can simply use the
It works because
+
operator:Code: Select all
string helloworld = "hello" + " " + "world";
+
has a special meaning for strings. (In C++, it's "overloaded".)Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Who is online
Users browsing this forum: Semrush [Bot] and 1 guest