c++ - Reading a 2D Array from the console -
i'm trying read 2-dimensional array console code wrong , reads twice last line, doing wrong??
example input:
1
01
10
output:
10
10
int n; cin>>n; char *a=new char[n,n]; for(int i=0; i<n; i++) { for(int j=0; j<n; j++) { cin>>a[i,j]; } cin.ignore(); }
looking @ code take trying make 2d array dynamic size, syntax wrong declaring populating array. think of 2d array array of pointers array. question has been asked , answered:
Comments
Post a Comment