Matrix Arithmetic using Vectors in C++ causing segmentation faults

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

    Matrices are created when row and col are zero, so any attempt to access their contents results in a segmentation fault. You need to first read row and col, and then build the matrices. This excludes making them global variables.

提交回复
热议问题