Take a look at the link i just posted.
Take a look at the link i just posted.
I highly doubt anyone knows what you are trying to ask...
I'm afraid that the attached NC.c does nothing to elucidate your question
Hey man. sorry for that. im doing some program on generating random numbers in an 2d array. i could put in the random numbers with loop. but i just dont know how to put an array of 9x9 into the code. I am stucked at where should i put it in. @@
so sorry if any misunderstandings. Thanks.
posting-code-read-first: Announcements - General Programming Boards
Whats the problem with array?
Code:int arr[9][9];
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Why not use two for loops. Add a variable int r (for the row variable), and put it around the current for loop you have in the program, already.
That's not the only way to work with a 2D board, but it's the easiest way, imo.Code:for(r=0; etc.) { for(c=0; etc.) { //your random code in here } }
Yup. i solved it myself already. Thanks again!
![]()
Why i get 10x9 instead of 9x9?
And why my random numbers won't generate when i run the program the next time? the numbers appear the same in every array.
thanks
Why do you think you are getting 10x9, and why do you think the numbers are the same each time? I ran your code twice, and got two different 81x1 outputs.