That should work OK. I entered the following:
CString myStrings[10];
myStrings[0]="Line 1";
myStrings[1]="Line 2";
AfxMessageBox(myStrings[0]);
AfxMessageBox(myStrings[1]);
and it worked just fine (did what I expected).
CStringList or CStringArray work nicely for this sort of thing, but I much
prefer CStringArray. The nice thing about using the collection class is
that it will grow dynamically as you need to add more elements.
Tom
Quote:
> Hello friends i am trying to decalre an array of CString type by
> writing the following syntax
> CString anArray[10];
> anArray[0]="HI";
> But this syntax is not working my main aim is to store strings in an
> array, the strings are like "ButtonPress()". i want to store a number
> of strings of this type in an array but CString is not allowing me
> that Kindly refer me some thing else
> regards
> Basim