Help concatenating *chars

I am struggling with concatening some *chars

int lineId = 1;
char* RFID= "74986930fh5";
char* CO_OP="A1"; 
char* VALOR="344";
char* marca="*";

char* str="";

void setup(){
    Serial.begin(9600);
    Serial.println("Lets rock");
}


void loop(){
  Serial.println("start");
//Make STRING CON lineId + RFID + CO_OP + VALOR + MARCA
  strcpy (str,lineId);
  strcat (str,",");
  strcat (str,RFID);
    strcat (str,",");
  strcat (str,CO_OP);
    strcat (str,",");
  strcat (str,VALOR);
    strcat (str,",");
  strcat (str,MARCA);

  Serial.println(str);
  Serial.println("End");
  delay(1000);
}

When I test it, serial outputs trash… any ideas how to fix this.

I need to contact all into a new char*, to MD5 it.

Any help will be much appreciated.

str needs to be declared as a character array with enough room to hold all the characters that you are storing, plus the null on the end. Try:

char str[24];

Also, this statement:

  strcpy (str,lineId);

is going to give you problems because lineId is not a string. Either change it to a string or use sprintf to convert it to a string.

Pete