smart parking system coding help needed

  const char*str;
  for(i=0;i<4;i++){
    if(slot[i]){
      str=strcat("P",(char*)i);
    }
  }
  strcat(str,"Are Free")

you cannot write a c string to a pointer, you need a buffer big enough to accept all of the chars:

  char str[SOME_BIG_ENOUGH_SIZE];
  for(i=0;i<4;i++){
    if(slot[i]){
      //str=strcat("P",(char*)i); don't know what you are trying to do there
    }
  }
  strcat(str,"Are Free");  // appends str with the literal "Are Free"