I am trying to format and merge the strings (with sprintf) and then print them with printf. But it does not work, and I have no clue why. The error is that string is not initialised.
int main() {
char wochentag[] = "Freitag";
int tag = 13;
char monat[] = "Mai";
int jahr = 1927;
char *string;
char *array=(char *) malloc(26*sizeof(char));
sprintf (string,"%s" "%d" "%s" "%d",wochentag,tag,monat,jahr);
printf("%s\n", string);
free(array);
return 0;
}