Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Helo 伙计们,我正在使用 CStringArray 工作,我想知道如何找到添加到 CStringArray 中的数据数量。在下面我将数组的大小定义为 10 但我只添加了三个 3 数据,所以我想知道添加到数组中的数据数量。(这里是 3)。有什么办法可以做它在 CStringArray 中查找添加到数组中的数据数
CStringArray 文件路径[10] = {path1.path2,path3};
CStringArray::GetCount()
编辑: 在上面的代码中,您实际上创建了一个 CStringArray 数组。我假设您是指 Microsoft MFC 库中的 CStringArray?
我认为你想做类似的事情:
CStringArray filepaths; filepaths.Add( path1 ); filepaths.Add( path2 ); filepaths.Add( path3 ); filepaths.GetCount(); //should ==3