This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

const unsigned int

This are some of my const agreements.
It works.

#define Clock (32768*1275)
const unsigned int Mem_size[8] = {
32,
320,
3200,
3200,
3200,
3200,
3200,
3200
};
// Delay-time * Clock * 1024 / 10 / Mem_size[0~7]
const unsigned int Multiplicator[8] = {
0.0001 * Clock * 1024 / 10 / 32,
0.001  * Clock * 1024 / 10 / 320,
0.01   * Clock * 1024 / 10 / 3200,
0.1    * Clock * 1024 / 10 / 3200,
1.0    * Clock * 1024 / 10 / 3200,
10.0   * Clock * 1024 / 10 / 3200,
100.0  * Clock * 1024 / 10 / 3200,
1000.0 * Clock * 1024 / 10 / 3200
};


But one const can not refer to another const.
For example i can not replace the number 3200 by
Mem_size[2].
Why not? Is there a work around?

Sincerly yours

Parents Reply Children
No data