C++ Vector of vectors

后端 未结 5 761
不思量自难忘°
不思量自难忘° 2021-02-06 01:56

I have a class header file called Grid.h that contains the following 2 private data object:

vector column;
vector> row;
         


        
5条回答
  •  逝去的感伤
    2021-02-06 02:42

    It appears to me (although you may need to verify this on your own, I don't feel like writing up a test application) that the problem is coming from the fact that your parameter contains a named row and your class has an inner variable row and there is a naming conflict.

    You may need to qualify which row you're using. Consider:

    return Grid::row[row][col];
    

提交回复
热议问题