Matrix Arithmetic using Vectors in C++ causing segmentation faults

后端 未结 7 1203
执笔经年
执笔经年 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:43

    You're not resizing the vectors/matrices to the dimensions that the user put in - they're stuck at row == 0, col == 0 because that's what the two variables default to.

    You'd want to look at vector::resize() to update the dimensions of the vector after the user input.

提交回复
热议问题