Click to See Complete Forum and Search --> : Strings and Character Arrays..


somu0915
February 18th, 2008, 01:44 AM
Hi,
I am very new to Visual C++.
I am developing a very simple windows form application.
I have included a cpp file which processes all the logic.

When the function returns, i also need to process the character pointer back to string type in a label..
I guess this would be the solution:

this->label1->text = System::String(var).ToString();

But to do this, I have a textbox in the form and I need to pass a string as a character pointer to the cpp file..

how to do this?


What if I have a character array in the cpp file??
What would be the code to return character arrays and convert them to string to display in labels or textboxes??
And the vice versa, that is how to convert the strings in a label or textbox to convert to character arrays and pass them to the cpp file???

Kindly help..

darwen
February 19th, 2008, 06:28 PM
You shouldn't need to translate if it's a "simple windows forms application" as you state.

Just pass System::String around - it's got all the string handling methods you'll ever need.

Darwen.