Hi,
This is my code:
#define NUMBER_OF_ROWS 50 #define NUMBER_OF_COLS 2 unsigned int Array[NUMBER_OF_ROWS] [NUMBER_OF_COLS] = { {100,50}, {20 ,10 }, {16 , 8 }, {14 , 7 }, {12 , 6 }, {11 , 5.5 }, {10 , 5 }, {9.1, 4.55}, {2 , 1 } and so on until 50 rows..};
The problem is I have 50 elements needed for a lookup table, but the following error occur: Array.h(57): error C242: 'array[]': too many initializers
When I initialize number of rows to 45, no error prompt. I need to use all the 50 elements. Is this the only way for me to create a lookup table? Can someone guide me on using more simpler method? Please help me. Thanks.
I have change from int to float. will not be stubborn in the future About hiding my codes,it is a waste of time. What did you learn in the process of implementing is more important.
Yea, I need to be more cautious in my coding. About the "code hiding", I created a formula and my boss asked me to give the formula to other engineers and don't let them to modify my formula. At first I thought of just letting them call the function without seeing the code, but there is no difference because most of the people can open what you hide.
Giving a "formula" to other engineers without letting them modify it is what you normally do by supplying it pre-compiled. So Keil supplies some of their framework as linkable libraries.
Not intended to hide what it does. But it takes reverse-engineering for anyone to be able to modify it.
Truly hiding code is for a formula that just no one must be able to understand how it works. That's what the media industry tries with games and films. And people are still managing to read out the information needed to be able to decrypt the latest BD films - even when the film industry spent a huge amount of money foolishly trying to protect it.
In the end, it's a question of interest. If there are enough interest, then people will find a way to reverse-engineer the "protected" code.
creating a static lib will help you to achieve atleast some security (unless any other engineer spends some time to reverse-engineer it). after creating a lib, you just have to share the .lib file and the header files. (the same way as we use standard C libraries without having/bothering-about the actual code)