Daniel said:
In the example that I gave, s=s+b resulted in s. The b did not get
concatenated. As for standard C++ or C++/CLI, I can't tell the difference.
I'm not that well versed in the technology to be able to tell you.
Daniel:
To answer your question, if I do
String^ s = L"1234";
byte b = 53;
s = s + b; // or s +(char)b
then I get "123453" (isn't this what happened for you?).
But if I do
String^ s = L"1234";
byte b = 53;
s = s + (wchar_t)b;
then I get "12345", which I think is what you wanted.
This is because System::String contains wide characters (wchar_t), not 8-bit
characters (char), and the + operator is overloaded for wchar_t.
Note that, although you can initialize System::String with "" string (8-bit
string), you should always use L"" (wide string) in C++/CLI.
C++/CLI is not an easy language, and you might well be better off learning C#.
C++/CLI is essentially standard C++ and C# combined together in one (often
confusing) language.