+ 1
Can someone explain me the syntax and logic of original 2D Array . Please, I'm so fed up of its syntax.
I don't know the reason but I'm unable to understand it especially USER INPUT part.
9 odpowiedzi
+ 3
If you are asking how to take user input ,you can do something like this ,
int a[2][2] //declare an array of 2×2 dimensions
int i,j //varaibles declaration
//run a loop now
for(i=0;i<=2;i++){
for(j=0;j<=2;j++){
scanf("%d",&a[i][j]);
}
}
first outer loop will run and you will get access to first row ,then inner loop will run which will fill all the values in that particular row ,if this isn't what you want to know be more specific
0
Martin Taylor I'm asking for original array. Especially generic part.
0
Im sorry USER INPUT.
0
Abhay just add one more thing in it. And thanks for the rest of it. What if we don't know the size of array.
0
Uzair sorry don't know about how to take input for unknown array size ,and what do you mean by "just add one more thing in it"?