Hello All,
I have come across a problem as explained below in a sample. Please
help me if anyone has any ideas to solve this.
I have a #define as defined below.
#define MAX 200
int _tmain(int argc, _TCHAR* argv[])
{
int arr[MAX];
return 0;
}
Here we do not have any problem. I have a situation and I want to make
this MAX value as a variable. As per C rules we can not do that and
compiler gives error. In my actual problematic code this kind of code
is at lots of places. And also at certain places we have code like
below.
typedef struct _xxxxx
{
....
byte val;
uint array[MAX];
}xxxxx;
So what would be the best solution with minimal effort to replace
#define value MAX with a variable which I can change anytime.
Thanks in advance and awaiting for some response soon.