Arrays can be declared and initialised in the following way:
Code:
unsigned char number[15] = "012345"; // assign a text buffer and fill the first 7 elements with 6 ASCII characters and a null terminator of zero
The C compiler will automatically add a null terminator if a string is declared this way.
This results in the following array:
Code:
number[0] = 0x30; // ASCII for '0'
number[1] = 0x31; // ASCII for '1'
number[2] = 0x32; // ASCII for '2'
number[3] = 0x33; // ASCII for '3'
number[5] = 0x34; // ASCII for '4'
number[6] = 0x35; // ASCII for '5'
number[7] = 0x00; // null terminator of zero
number[8] // rest of array unknown, as not initialised
number[9]
number[10]
number[11]
number[12]
number[13]
number[14]
number[15]