Hi all.
I'm kinda new in programming, actually I'm a student.
I just want to know how to randomize and obtain 0 or 1.
I DID THIS, BUT ALL I GET IS A 10x8 MATRIX 0's:
WHAT'S WRONG?
int _tmain(int argc, _TCHAR* argv[])
{
int matr[10][8];
for (int i = 0; i < 10; i++)
{
for (int k = 0; k < 8; k++)
matr[i][k]=rand() % +2;
}
for (int i = 0; i < 10; i++)
{
for (int k = 0; k < 8; k++)
cout << matr[10][8] << " ";
cout << endl;
}
system("pause");
return 0;
}