Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/124.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 列表向量如何引用列表中的值?_C++_List_Vector - Fatal编程技术网

C++ 列表向量如何引用列表中的值?

C++ 列表向量如何引用列表中的值?,c++,list,vector,C++,List,Vector,在没有pop delete的情况下,如何通过指针创建引用列表中的值的列表向量? 向量[I].j必须引用向量向量中列表中的值 但是vec[i].j不起作用 vector<list<int>>vec; for (auto j = vec[i].begin(); j != vec[i].end(); j++) for (auto h = map.begin(); h !=map.end(); ++h) if (vec[i].

在没有pop delete的情况下,如何通过指针创建引用列表中的值的列表向量? 向量[I].j必须引用向量向量中列表中的值 但是vec[i].j不起作用

vector<list<int>>vec;

for (auto j = vec[i].begin(); j != vec[i].end(); j++)
    for (auto h = map.begin(); h !=map.end(); ++h)              
        if (vec[i].j == h->first)
            f = false;
应改写为

if (*j == h->first)

修正你的代码格式,以及你文章中的几十个打字错误,这样我们就可以试着理解你的问题。java和C++也是两种不同的语言。挑一个。-1,请澄清你的问题,我不明白。
if (*j == h->first)