ide is 1.02
i am trying to figure out how to create a char array with an unknown text size
here some code, this first part of code gets executed during my Void loop when there is a card fully inserted into a mag stripe reader, this works as written. I want to add a name after welcome and of course the name is an unknown length, the name using char Z[] array( i know z doesnt reflect name, but z is the array i am using for all recieved data and at this point it happens to a name) is retrieved further down the loop in my card reader routine and that section is working i can lcd.print the name to the lcd.
i would like to add the name to the char welcome[] array but unsure how to join the text "Welcome " to z and have it in welcome[]
char welcome[] = "Welcome ";
// strcopy(welcome2,welcome);
// strcat(welcome2,name);
Mlength=sizeof(welcome)-1;
Dlength=16;
if (delayMilliSeconds(1,200))
{
lcd.setCursor(0, 0);
for (byte CC = 0; CC < (Dlength-pass);CC++)
{
lcd.print(" ");
}
for (byte CC = max(0,min(Mlength,pass-Dlength)); CC < min(Mlength,pass);CC++)
{
lcd.print(welcome[CC]);
}
for (byte DD = 0; DD < (Dlength-(min(Mlength,pass)- max(0,pass-Dlength)+ max(0,Dlength-pass) ));DD++)
{
lcd.print(" ");
}
pass = pass++;
if (pass >Mlength + Dlength)
{
pass = 1;
}
Messagetimer = micros();
}