Page 1 of 1

String Construct in NXC

Posted: 28 Apr 2011, 09:28
by bungeshea
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.

Re: String Construct in NXC

Posted: 28 Apr 2011, 09:38
by timpattinson
StrCat("abc","123");
?
yay for inline codetags "["c"]" "["/c"]"

Re: String Construct in NXC

Posted: 28 Apr 2011, 23:02
by muntoo
Or, you can simply use the + operator:

Code: Select all

string helloworld = "hello" + " " + "world";
It works because + has a special meaning for strings. (In C++, it's "overloaded".)