I am quite new to C programming. I encountered this error while compiling my program. I have tried to look around the internet for a solution but to no avail. The error is on the line num = rand()%20;
char* getParameter(char *name)
 {
   char *num;
   char *buffer;
   if(strcmp(name,"Trainingsprogramm")){
    srand (time(NULL));
     num = rand()%20;;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"Personnenummer")){
     srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"Tretzustand")){
     srand (time(NULL));
     srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"Tretleistung")){
     srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"Drehzahl")){srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"Geschwindigkeit")){srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"GefahreneDistanz")){srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"RealeKJoule")){srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"AktuellerPuls")){srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"MomentanerGang")){srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"RelaxBetrieb")){srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}else if(strcmp(name,"VerbrauchteKJoule")){srand (time(NULL));
      num = rand()%20;
    sprintf(buffer,"%d",num);
}
return buffer;
}
 
     
     
     
    