tags:

views:

125

answers:

1

Helo guys, I am working wid CStringArray and i want to know how to find the number of datas added in a CStringArray . in the below i have a defined the size of the array as 10 but i have added only three 3 data,So i want to know the number of data's added to the array.(here its 3).Is there any way we can do it in CStringArray to find the number of data's added to array

CStringArray filepaths[10] = {path1.path2,path3};

A: 

CStringArray::GetCount()

Edit: In your code above you have actually created an array of CStringArray's. I am presuming you mean CStringArray from the Microsoft MFC library?

I think you want to be doing something like:

CStringArray filepaths;
filepaths.Add( path1 );
filepaths.Add( path2 );
filepaths.Add( path3 );
filepaths.GetCount(); //should ==3
Alex Deem
int test = filepaths[10].GetCount();no its not working its giving a large value..i tried that before
kiddo
I edited the answer to add more information. I may be misunderstanding what you're trying to accomplish, if so please clarify.
Alex Deem
nope its was'nt working..wat i did was..i switched to CString* instead of CStringArray.....
kiddo