rosicky1234

In C#, there is coding on string like this, to declare 2D array of string :

Code Block

Detail = new string[10][];

Detail[0] = new string[] {"A","B","C"};

Detail[1] = new string[] {"D","E","F"};

............

.............

Then how can I convert the above in a C++ environment




Re: Smart Devices Native C++ Development CString conversion

Hammadi Dali


Hi

You can use the class CStringArray witch can answer to your request, and this is a nice article about Extending CStringArray can help you in addition to this tutorial.


Regards
Hammadi




Re: Smart Devices Native C++ Development CString conversion

Patrick Getzmann

or you can use something like this:

Code Block

char szArry[3][10] = {"TEST", "test1", "Test2"};
char szTmp[10] = "\0";
strcpy(szTmp,szArry[0]);
strcpy(szArry[1],"TEST3");





Re: Smart Devices Native C++ Development CString conversion

rosicky1234

Thanks all of you!

I still have one question to ask. How can I convert char array into CString, so that I can pass the variable into list box






Re: Smart Devices Native C++ Development CString conversion

Hammadi Dali

Hi
try in this way

Code Block

CString myStr("");
Char Data[100];
myStr=(CString)Data;



You can also do that by the use of CString Format

Regards
Hammadi