i have problem with CString please help me
-
hi all i want to allocate memory for two diamentional sring like CString mydata=new CString[10]; for "TWO DIAMENTION". I done CString mydata=new CString[10][10]; but compiler raise error how can i solve this problem; thank u in advance malik
-
hi all i want to allocate memory for two diamentional sring like CString mydata=new CString[10]; for "TWO DIAMENTION". I done CString mydata=new CString[10][10]; but compiler raise error how can i solve this problem; thank u in advance malik
Try with this CString *mydata=new CString[10];
-
hi all i want to allocate memory for two diamentional sring like CString mydata=new CString[10]; for "TWO DIAMENTION". I done CString mydata=new CString[10][10]; but compiler raise error how can i solve this problem; thank u in advance malik
What is your requirement ? Will
CStringArray
helpful ? Regards, Paresh. -
hi all i want to allocate memory for two diamentional sring like CString mydata=new CString[10]; for "TWO DIAMENTION". I done CString mydata=new CString[10][10]; but compiler raise error how can i solve this problem; thank u in advance malik
-
Try with this CString *mydata=new CString[10];
Sorry this is wrong, u have to use CStringArray Class
-
Sorry this is wrong, u have to use CStringArray Class
-
hi all i want to allocate memory for two diamentional sring like CString mydata=new CString[10]; for "TWO DIAMENTION". I done CString mydata=new CString[10][10]; but compiler raise error how can i solve this problem; thank u in advance malik
rajneshmalik wrote:
i want to allocate memory for two diamentional sring
try typedef std::vector<CString> vecCString; typedef std::vector<vecCString> vecTwoDimensionCString; typedef std::vector<vecTwoDimensionCString> vecThreeDimensionCString;
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
hi all i want to allocate memory for two diamentional sring like CString mydata=new CString[10]; for "TWO DIAMENTION". I done CString mydata=new CString[10][10]; but compiler raise error how can i solve this problem; thank u in advance malik
While you probably should use an array class as others have mentioned, you can create multi dimension arrays on the heap if you use the proper syntax: CString (*mydata)[10] = new CString[10][10]; ... delete[] mydata;
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
rajneshmalik wrote:
I done CString mydata=new CString[10][10];
Two dimension array cannot be created like this. You have to do like
CString** pStr = new CString* [10]; for( int i = 0; i < 10; i++ ) pStr[i] = new CString[10];
- NS -
hi first thank u to help me,my concept r not so clear because i m new for mfc but i want to describe my problem to u. i have a directory that have unknown number of file i want to show and sort those file for this i want a CString type variable(object) so that i can show those file,i think u have to modefied ur statement.i am also getting memory leak problem.please reply soon thank u malik
-
While you probably should use an array class as others have mentioned, you can create multi dimension arrays on the heap if you use the proper syntax: CString (*mydata)[10] = new CString[10][10]; ... delete[] mydata;
Mark Salsbery Microsoft MVP - Visual C++ :java:
hi first thank u to help me,my concept r not so clear because i m new for mfc but i want to describe my problem to u. i have a directory that have unknown number of file i want to show and sort those file for this i want a CString type variable(object) so that i can show those file,i think u have to modefied ur statement.i am also getting memory leak problem.please reply soon thank u malik
-
hi first thank u to help me,my concept r not so clear because i m new for mfc but i want to describe my problem to u. i have a directory that have unknown number of file i want to show and sort those file for this i want a CString type variable(object) so that i can show those file,i think u have to modefied ur statement.i am also getting memory leak problem.please reply soon thank u malik
rajneshmalik wrote:
i have a directory that have unknown number of file i want to show and sort those file for this i want a CString type variable(object) so that i can show those file,
In that case I don't see why you need a multi-dimension array. Directory listings are one-dimensional. A CStringArray is an excellent choice IMO. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
hi first thank u to help me,my concept r not so clear because i m new for mfc but i want to describe my problem to u. i have a directory that have unknown number of file i want to show and sort those file for this i want a CString type variable(object) so that i can show those file,i think u have to modefied ur statement.i am also getting memory leak problem.please reply soon thank u malik