Tengo este código y me sale este error:
15981 segmentation fault (core dumped)
¿Qué tengo mal?, es decir en teoría ahí funcionaría la matriz normal , pero me sale error de memoria, no sé si afecte pero estoy en Linux 20.04, compilando con g++
#include<iostream>
using namespace std;
int main(){
int a [3][3] = {
{1,2,3},
{1,2,3},
{1,2,3}
};
int i,j = 0;
while(i < 3){
while(j < 3){
cout<< a [i][j];
j ++;
}
cout << "\n";
j = 0;
i ++;
}
return (1);
}
i=0
, sóloj