I'll add corrections as I go...
1) Use code tags.
Code:
#include<time.h>
#include<stdlib.h>
#define ROWS = 5
#define COLUMNS = 20
/*
Error #1 - You have no { } around
the main function.
*/
int main (void)
{
/*
srand(time(NULL));
Error #2 - Declare variables before
calling any functions. This is C, not
C++.
*/
int array[ROWS][COLUMNS];
int i, j, x
/*moved to here */
srand(time(NULL));
/*
for (i=0; i<100; i++);
Error #3 - Not technicly an error, but
not what you want. Your ; at the
end of the for() function makes your
function not do anything useful.
Error #4 - You should really use { }
whenever you want to create blocks
of code. Since I don't know where
you plan on blocking things off, I'll
assume.
Error #5 - You shouldn't treat
multidimensional arrays as single
dimension arrays. I believe technicly
they're the same thing, but it's
generally bad form. As such, this
should be a nested loop.
Additionally, you should use your
define here as a loop counter
instead of a static number.
If you want to tread them as a
single dimensional array here, do
like so:
*/
for( i = 0; i < (ROWS*COLUMNS); i++ )
{
/*
This line does nothing. What are you trying to do here?
*/
array[i]
I'll assume you're trying to assign some random value, but I'll stop here and let you see what you can some up with.
Remember: for every { you need one and only one }
Quzah.