char and char x[] i don't understand the behavior of that

hello ,
few days ago i did post to get some help on a CRC calculation and i did maneged to include a peace of code in my own code...

now i have some trouble with the char value ,i'm really a newbie so i'm sure that's not a bug but a real missundertanding of the programing language

'im able to control the LUT colors by changing the variable declaration in void( setup) but i don't know how to change that in void (loop) on demand:

void setup()
{
  Serial.begin(57600);
  mouse_one.initialize();
  mouse_one.set_scaling_1_1();
  pinMode(13, OUTPUT);      // sets the digital pin as output
   delay (8000);
  
char Header [3] = {
0x6E,0x00,0x00};
char Function [1] = {
0x10}; 
char ByteCount [2] = {
0x00,0x02};  //02
char CRC1[6] ={
Header[0],Header[1],Header[2], Function[0],ByteCount[0], ByteCount[1]};
char Data[2] ={
0x00,0x0B};
char CRC2[2] ={ 
Data[0],Data[1]};



  switch (colors_LUT) 
  {
case 1://rainbow  
     {        
    char Function [1] = {
    0x10};                     
    char ByteCount [2] = {
    0x00,0x02};  //02
    char Data[2] ={
    0x00,0x0B};
     }
 break; 
case 2://sepia  
{
    char Function [1] = {
    0x10}; 
    char ByteCount [2] = {
    0x00,0x02};  //02
    char Data[2] ={
   0x00,0x07}; 

  }



  if (transmit == 0)
  {
  //Serial.println("transmit");// rainbow colors sentence :6E,$00,$00,$10,$00,$02,$BC,$9A,$00,$0B,$B1,$6B
  crc_out1 = calc_crc(CRC1,6); //Calculate CRC on-the-fly 
  crc_out2 = calc_crc(CRC2,2); //Calculate CRC on-the-fly 
 
 Serial.write( (uint8_t*)Header, sizeof(Header)); //why need -3 ??
 Serial.write( (uint8_t*)Function, sizeof(Function));
 Serial.write( (uint8_t*)ByteCount, sizeof(ByteCount));
 
 //crc2 calculated manualy
 //Serial.write(188);
 //Serial.write(154);
 Serial.write(crc_out1 >> 8);     //MSB
 Serial.write(crc_out1 & 0xFF);  //LSB

 Serial.write( (uint8_t*)Data, sizeof(Data)); 

//CRC2 cxalculated manualy
 //Serial.write(177);
 //Serial.write(107); 
 Serial.write(crc_out2 >> 8);     //MSB
 Serial.write(crc_out2 & 0xFF);  //LSB
// Serial.write(10);  //CR
// Serial.print(transmit);
 transmit =1 ;
  }

ok so i would like to be able to change the color LUT of my thermal camera with the select case but i have no idea how to change the values in my char buffer, i know this is a bad way to do that:
char Function [1] = {
0x10};
char ByteCount [2] = {
0x00,0x02}; //02
char Data[2] ={
0x00,0x0B};

but i would like to be able to change that values so i can send to serial port other values . and if it is possible to even write ,for example in Data[2] the two bytes as an integer (keeping the two byte to be send) it is even better ex: 000B = B

is there a way to do so, is there some advance documentation about variable (i'm kind of lost...)?

Moderator edit: quote tags swapped for code tags

You haven't posted your loop function, but variables declared inside setup are not visible to any other function.
Declare the variables outside of functions to give them global scope.

sorry i didn't post the whole code because it is a big mess (learning) if you want it i can post it...

but i also try to declare that before the setup, what i don't know is the syntax to change the value char [x] {0x00,0x0B] in my loop

Moderator edit: code tags again.

You can do it one array element at a time, or you can use memcpy.

sorry for the code tag!

one array element at a time sounds good:

will it be something like so?

Data[1] = 0x0B;
Data[2] = 0x00;

Yes, but don't forget indices start at zero, not one.

oh yes of course, thanx i'll try right away.

ok it works very well:

if(Mdata[0]==9)
  {
    clic=0;
    Mdata[0]= 0; //mouse data
   }
  
    
    Data[0] = 0x00;   //type of color  White hot Black hot Fusion Rainbow Globow Ironbow1 Ironbow2 Sepia Color1 Color2 Ice and fire Rain Custom #1
    Data[1] = page;      //from 0 to 12
    
  }//wend