string Array
-
CStringArray myclass::getStr() { CStringArray csa; csa.Add("str1"); csa.Add("str2"); return csa; } I got this error what to do? error C2558: class 'CStringArray' : no copy constructor available How to return two dimensional array? JAYARAJ
Rather than returning the value, pass the paramter as a reference. void myclass::getStr(CStringArray& csa) { csa.Add("str1"); csa.Add("str2"); }
-
CStringArray myclass::getStr() { CStringArray csa; csa.Add("str1"); csa.Add("str2"); return csa; } I got this error what to do? error C2558: class 'CStringArray' : no copy constructor available How to return two dimensional array? JAYARAJ
This is my code snippet, and it does not work, since CStringArray does not implement a copy constructor (meaning that this probably fails to compile:
CStringArray csa=getStr();
Do as suggested above, pass the CStringArray as an argument to the function. ~RaGE();
-
CStringArray myclass::getStr() { CStringArray csa; csa.Add("str1"); csa.Add("str2"); return csa; } I got this error what to do? error C2558: class 'CStringArray' : no copy constructor available How to return two dimensional array? JAYARAJ
maybe it is some helpful to you ////h File//////////// CStringArray *a(); CStringArray* CAnswer::a() { CStringArray* a; a=new (CStringArray); a->Add("123"); a->Add("12"); return a; } if you check count then return ->2 CStringArray *b; b=a(); int cb=b->GetCount();
-
maybe it is some helpful to you ////h File//////////// CStringArray *a(); CStringArray* CAnswer::a() { CStringArray* a; a=new (CStringArray); a->Add("123"); a->Add("12"); return a; } if you check count then return ->2 CStringArray *b; b=a(); int cb=b->GetCount();
-
Hi, Works. Yet not a good solution. The caller is supposed to delete the array though it may not do it. The best choice, I think, is to pass by refernce as a parameter. -- ====== Arman
yes It's only a suggestion because we need to delete array