访问指针向量中的信息
accessing information in a vector of pointers
我当前有一个指针向量,如何cout
向量中特定指针处的信息?
我正在研究如何尊重存储在矢量中的地址。
vector<MyType*> addressList;
cout<<(*(addresssList[i])).Data ; //assuming Data is the content you want to output and you would like to output the content addressed by the `ith` element.
std::vector<int*> ints;
for ( auto cur = ints.begin(); cur != ints.end(); ++cur)
{
std::cout << (*(*cur)) << "n";
}
相关文章:
- 正在查找文档以获得PS4平台的C++中的设备信息
- 写入向量<向量<bool>>
- 函数向量_指针有不同的原型,我可以构建一个吗
- std::向量与传递值的动态数组
- 将值指定给向量(2D)的向量中的某个位置
- 将信息输入到下面显示的结构向量中的正确语法/格式是什么
- 将数组信息存储到 c++ 向量中有一个"Access violation reading location"
- 试图扫描车辆向量的插入信息,以换取C
- 从向量C 调用播放器统计信息
- C++从文件中读取信息并从该信息构建二维向量
- visual C++-试图将每个子类指向主类,以便在向量中包含所有信息
- 是否可以根据另一个向量的信息从一个向量中删除某些元素
- 读取文件并根据该信息创建对象向量
- 从数据库中选择客户端的信息并存储到向量中
- 尝试push_back()结构会导致2D向量中的信息不正确
- 向量正在丢失mat4信息
- 如何使用向量中的信息填充数组并从数组中选择随机项
- 访问指针向量中的信息
- 用户输入数字的错误信息/向量
- 将信息保存到哈希表或向量中