0

I want to initialize an array in global with a particular element as variable

unsigned char SlotID;
unsigned char array[]= {SlotID,0x8,0x5,0x3};
main()
{
  slotID= getslotid();// some function to get the value of slot id

}

I am getting error while compiling that slotID is not constant. Please tell what do I need to do. SlotID value I will retrieve from getslotid function and accordingly I pass array value to some other function.

Rohan Kushwaha
  • 738
  • 6
  • 18

0 Answers0