R
rupika
Hi can any one tell me if diff data types like int and short be
multiplied
in code.
i HAVE TO REDUCE THE MEMORY SIZE SO CHANGE DATATYPE OF nbr TO SHORT
WHERE ELSE DO I MAKE CHANGES.ALSO IF DATA TYPE OF NBR IS CHNGED CAN IT
BE MUTLIPLIED WITH SEN AND N WITHOUT CHANGING DERE DATATYPE
HELP ITS URGENT
THANK U
struct Node
{
int n;
int nbr[3][3][3];
};
Node sen[SIZE][SIZE][SIZE];
......
..
..
..
..
..int print(int nbr[][3][3])
{
int max = 0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 3; k++)
{
int m = nbr[j][k];
if (m > max )
max = m;
}
return max;
}
..
..
..
int main()
{
srand(time(0));
for (int a = 0; a < SIZE; a++)
for (int b = 0; b < SIZE; b++)
for (int c = 0; c < SIZE; c++)
{
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 3; k++)
{
sen[a][c].nbr[j][k] = -1;
}
sen[a][c].nbr[1][1][1] = 1;
}
for (int t = 0; t < TIME; t++) //time ticks
{
for (int i = 0; i < SIZE; i++)
for (int j = 0; j < SIZE; j++)
for (int k = 0; k < SIZE; k++)
sen[j][k].n = gen();
AM(t);
}
multiplied
in code.
i HAVE TO REDUCE THE MEMORY SIZE SO CHANGE DATATYPE OF nbr TO SHORT
WHERE ELSE DO I MAKE CHANGES.ALSO IF DATA TYPE OF NBR IS CHNGED CAN IT
BE MUTLIPLIED WITH SEN AND N WITHOUT CHANGING DERE DATATYPE
HELP ITS URGENT
THANK U
struct Node
{
int n;
int nbr[3][3][3];
};
Node sen[SIZE][SIZE][SIZE];
......
..
..
..
..
..int print(int nbr[][3][3])
{
int max = 0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 3; k++)
{
int m = nbr[j][k];
if (m > max )
max = m;
}
return max;
}
..
..
..
int main()
{
srand(time(0));
for (int a = 0; a < SIZE; a++)
for (int b = 0; b < SIZE; b++)
for (int c = 0; c < SIZE; c++)
{
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 3; k++)
{
sen[a][c].nbr[j][k] = -1;
}
sen[a][c].nbr[1][1][1] = 1;
}
for (int t = 0; t < TIME; t++) //time ticks
{
for (int i = 0; i < SIZE; i++)
for (int j = 0; j < SIZE; j++)
for (int k = 0; k < SIZE; k++)
sen[j][k].n = gen();
AM(t);
}