Matrix Arithmetic using Vectors in C++ causing segmentation faults

后端 未结 7 1287
执笔经年
执笔经年 2021-01-15 02:37

I\'m having some issues passing vectors to functions. My concern is not with my logic itself, as if I need to adjust later I will. My program requirements state that I must

7条回答
  •  半阙折子戏
    2021-01-15 02:55

    int row=0, col=0;
    vector > matrix(row, vector (col) );
    vector > matrix2(row, vector (col) );
    vector > matrix3(row, vector (col) );
    

    This creates the vectors while row and col are still zero, long before you read in the values.

提交回复
热议问题