generate array of random numbers

hi guys,
I am writing a c program that generates a two dimensional array to make matrix and a vector of random numbers and perform multiplication. I can't figure out whats wrong with my code. It generates a matrix of random numbers but all the numbers in the vector array is same and so is the result array. I don't see anything wrong with my multiplication algorithm but could anyone check it, please?

here is my code. help me figure out whats wrong with this

#include <iostream>
#include <cstdlib>
#include <time.h>

using namespace std;

const int mat_rows = 5;
const int mat_cols = 4;
const int vec_rows = mat_cols;
const int vec_cols = 0;

int matrix [mat_rows] [mat_cols];
int vector [vec_rows] [0];
int result [mat_rows] [0];
int res;

int main ()
{
srand (time(NULL));
/*Filling matrix with random value between 0 - 10 */
for (int i = 0; i < mat_rows; i++)
        for (int j = 0; j < mat_cols; j++)
                matrix [j] = rand () % 50;

/*Filling vector with random value between 0 - 10*/
for (int i = 0; i < vec_rows; i++)
        vector  [0]= rand () % 50;

cout << "Printing out the matrix" << "\n" << endl;
for (int i = 0; i < mat_rows; i++)
        {
        for (int j = 0; j < mat_cols; j++)
                cout << matrix [j] << "   ";
        cout << endl;
        }
cout << "Printing out the vector" << "\n" << endl;
for (int i = 0; i < vec_rows; i++)
        cout << vector  [0] << endl;

for (int i = 0; i < mat_rows; i++)
        {
        res = 0;
        int vrows = 0;
        for (int j = 0; j < mat_cols; j++)
                {
                res = res + ((matrix  [j]) * (vector [vrows] [0]));
                vrows++;
                }
        result  [0] = res;
        }

for (int i = 0; i < mat_rows; i++)
        cout << result  [0] << endl;

return 0;
}

thanks

hi ,
I could see the problem in below 2D Array declaration

int vector [vec_rows] [0];
int result [mat_rows] [0];

Formual two access array element is (base + icols + j).
Hence u have declared 'cols' size as Zero. Below statement overwrites on the same loc eventhough your incrementing i val.
for (int i = 0; i < vec_rows; i++)
vector [i][0]= rand () % 50;

same problem with 'result' array also

Change the declarations as below it will work
int vector [vec_rows] [1];
int result [mat_rows] [1];

Let me know if am wrong.

Thank you
Pradeep kumar

Friendly note:
It looks to me like you are writing C code and then compiling with C++. That is not a good idea, at all. It will cause you lots of pain sooner rather than later. Pick C or C++ and stick with the one you want. Don't play mix and match.