How to concatenate a SINGLE char?

strcat expects two strings, so how the heck am I to append a char? I need it to be a single char because I make comparisons with literal chars later on in another function. It compiles but warns me of the incompatibility.

currentBlock is a char

strcat(html2, currentBlock);

#include <EEPROM.h>

char currentBlock;

void setup() {
  Serial.begin(9600);
  char html0[550] = { 0 }, html1[100] = { 0 }, html2[100] = { 0 }, html3[100] = { 0 }, html4[100] = { 0 };
  char scheduleHHA[4] = { 0 };
  char scheduleMMA[4] = { 0 };
  char scheduleTempA[4] = { 0 };
  int scheduleHHi, scheduleMMi, scheduleTempi;
 char buff[10] = { 0 };
 
  currentBlock = 'A';
  strcpy(html0, "<!DOCTYPE html><html><head><title>Thermostat Schedule</title></head><body><hr>");
  strcpy(html1, "<table><tr><th> Time </th > <th> Temp. </th> <tr><td><a href=AHHUp> + </a>");


  strcat(html0, html1);
  for (int i = 0; i < 8; i++) {
    currentBlock++;
    Serial.print("currentBlock:");
    Serial.println(currentBlock);
    
    scheduleHHi = scheduleArray(currentBlock, 'r', "scheduleHH", 0);
    scheduleMMi = scheduleArray(currentBlock, 'r', "scheduleMM", 0);
    scheduleTempi = scheduleArray(currentBlock, 'r', "scheduleTemp", 0);

itoa(scheduleHHi,buff,10);
strcpy(scheduleHHA,buff);
itoa(scheduleMMi,buff,10);
strcpy(scheduleMMA,buff);
itoa(scheduleTempi,buff,10);
strcpy(scheduleTempA,buff);


    Serial.print("ScheduleTemp:"); Serial.println(scheduleTempA);

    strcpy(html2, "<a href=");
    strcat(html2, currentBlock);
    strcat(html2, "HHDown> - </a>");
    strcat(html2, scheduleHHA);
    strcat(html2, "<a href=");
    strcat(html2, currentBlock);
    strcat(html2, "HHUp> + </a>");
    
    strcat(html2, ": <a href=");
    strcat(html2, currentBlock);
    strcat(html2, "MMDown> - </a>");
    strcat(html2, scheduleMMA);
    strcat(html2, "MMUp> + </a>");
    strcat(html2, " </td> <td>");


    strcat(html3, ": <a href=");
    strcat(html3, currentBlock);
    strcat(html3, "TempDown> - </a>");
    strcpy(html3, scheduleTempA);
    strcat(html3, "TempUp> + </a>");
    strcat(html3, " </td></tr><tr><td>");

    strcat(html0, html2);
    strcat(html0, html3);
  }
  strcpy(html4, " </table> </body> </html> ");

  strcat(html0, html4);
  //Serial.println(html0);

}

void loop() {
  // put your main code here, to run repeatedly:
Serial.print("Ping!");
delay(1000);
}


int scheduleArray(char Block, char rw, char* item, int data) {
  int block;
  int out;
  int arrTimeHH[8], arrTimeMM[8], arrTemp[8];

  out = 0;

  if (Block == 'A') block = 0;
  if (Block == 'B') block = 1;
  if (Block == 'C') block = 2;
  if (Block == 'D') block = 3;
  if (Block == 'E') block = 4;
  if (Block == 'F') block = 5;
  if (Block == 'G') block = 6;
  if (Block == 'G') block = 7;
  //Serial.print('['); Serial.print(item); Serial.print(']');
  if (rw == 'r') { //Read data
    EEPROM.get(210, arrTimeHH);
    EEPROM.get(230, arrTimeMM);
    EEPROM.get(250, arrTemp);
    if (strcmp(item, "timeHH") == 0) {
      out = arrTimeHH[block];
    }
    if (strcmp(item, "timeMM") == 0) {
      out = arrTimeMM[block];
    }
    if (strcmp(item, "temperature") == 0) { //Do NOT use "temp" - for some reason doesn't work.
      out = arrTemp[block];
    }
  }
  if (rw == 'w') { //Write data
    if (strcmp(item, "timeHH") == 0) {
      arrTimeHH[block] = data;
      EEPROM.put(210, arrTimeHH);
    }
    if (strcmp(item, "timeMM") == 0) {
      arrTimeMM[block] = data;
      EEPROM.put(230, arrTimeMM);
    }
    if (strcmp(item, "temperature") == 0) {
      arrTemp[block] = data;
      EEPROM.put(250, arrTemp);
    }
  }
  return out;
}

I need it to be a single char because I make comparisons with literal chars later on in another function.

Make the single character into a C style string terminated by '\0' so that strcat() works and use strcmp() later to do the comparison.

If this

  if (Block == 'A') block = 0;
  if (Block == 'B') block = 1;
  if (Block == 'C') block = 2;
  if (Block == 'D') block = 3;
  if (Block == 'E') block = 4;
  if (Block == 'F') block = 5;
  if (Block == 'G') block = 6;
  if (Block == 'G') block = 7;

is the comparison you mean then you don't even need to do it. Replace it with

block = Block - 'A';

Rubbish choice of variable names by the way !

Thanks HeliBob.

Umm. How do i get the char into a char string? strcat and strcpy expect strings.

Answered myself.

char *currentBlock;
char *pCurrentBlock = &currentBlock;

Now everything is working.

mattlogue:
Umm. How do i get the char into a char string? strcat and strcpy expect strings.

Answered myself.

char *currentBlock;
char *pCurrentBlock = &currentBlock;

Now everything is working.

I doubt that the above will work, but without seeing the actual code that's hard to see.

You could use a function like strcat but for a single char like so

void setup() {
  char buff[20] = "append a ";
  Serial.begin(250000);
  Serial.println(chrcat(buff, 'B'));
}

char* chrcat(char* appendTo, char what) {
  size_t len = strlen(appendTo);
  appendTo[len] = what;
  appendTo[len + 1] = 0;
  return appendTo;
}

void loop() {}
append a B

mattlogue:
char *currentBlock;
char *pCurrentBlock = &currentBlock;

Now everything is working.

Doesn't even compile, the data types are incompatible. 'pCurrentBlock' and 'currentBlock' are type char *. But, '&currentBlock' is the address of a char * (i.e. a char **).

  if (Block == 'G') block = 6;
  if (Block == 'G') block = 7;

Interesting...

Why not just stick it in the array? Do you really need a function to do that?

int x = strlen(myString);
myString[x] = whateverChar;
myString[x+1] = 0;

You could have a check that x is in bounds of the array of you want. Probably a good idea. This could easily be made a function that takes a char pointer and a char.

Oops that's already an answer. Sorry, I missed that

DanCrumb suggested using the &.

The way he suggested literally won't work but I just declared currentBlock as a char. It compiled and ran and fixed my conundrum.

You are relying on some zero character (a byte with a zero in it) being supplied by other variables than currentBlock.
This will probably give you some surprises in the future.

You could use

char currentBlock[2] = { 'A', 0 };

  Serial.write(currentBlock[0]);  // access character
  Serial.print(currentBlock);     // access c-string

mattlogue:
DanCrumb suggested using the &.

C Convert char into char* - Stack Overflow

Yes, that does give you a char *. But it doesn't give you a NULL-terminated c-string as required by strcat (THAT's what you asked for in your original post). Read the very next post (by Daniel) in that SO thread.

The way he suggested literally won't work but I just declared currentBlock as a char. It compiled and ran and fixed my conundrum.

No, as mentioned, it has simply set you up for undefined and unexpected behavior. Multiple posts in this thread have shown how to do it correctly (and also the SO post by Daniel).