469,613 Members | 1,573 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

C++ .NET convert character array to String

I am working on Visual C++ 2005. I have a character array (array<Char>) and want to convert it to string. I know I can do this with the String constructon (gcnew String(charArray)), but is there no other way without allocating memory? I have in mind the GetString method of System::Text::Encoding::ASCII but couldnt manage to do what I wanted to do.
Thanks in advance for any help.
Jul 3 '07 #1
2 1779
vanc
211 Expert 100+
char[] arrayofchar;
string temp;
foreach(char c in arrayofchar)
temp += c;

:D, cheers.
Jul 4 '07 #2
That was nice thanks
Jul 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by David Lawson | last post: by
15 posts views Thread by Kueishiong Tu | last post: by
14 posts views Thread by rtillmore | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.