c== cli array

Hello

I am trying to create an array to hold a String value. However, when I try to input it with a value then it comes up with this compile error

 
	error C2440: 'initializing' : cannot convert from 'const char [6]' to 'cli::array<Type> ^'


Can someone tell me what I might be doing wrong?

Thanks
closed account (1vRz3TCk)
shamas21 wrote:
I am trying to create an array to hold a String value. ...
Can someone tell me what I might be doing wrong?
Why are you trying to create an array to hold a string in the first place? But to answer your question, not without seeing the code that generates the error.
Can I have the code you made?
Hi Guys

Thanks for your replies. I managed to fix it just now before re-visiting this post.

Before
 
       array<String^>^ arr = "this is a string";


After
 
       array<String^>^ arr = {"this is a string"};


I put in the braces before and after the string value.

Thanks again.
Topic archived. No new replies allowed.