Allocate a Label Through a char ** Out-Parameter
mediumQuestion 462Complete this function (the signature is given and must not change):
void make_label(const char *name, int count, char **out)
It must allocate a new string holding name, then x , then count — for example bolts and 7 produce bolts x 7 — and store that pointer in *out.
In main, read a word and an integer from input (separated by a space), call make_label, then print two lines: Label: followed by the string, and Length: followed by the number of characters in that string.
For the input:
bolts 7
the output is exactly what is shown in Expected Output.
Each line ends with a newline. The word is never longer than 31 characters.
Free the memory you allocate before the program ends — this question checks for memory leaks.
Expected output
Label: bolts x 7 Length: 9
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...