Pergunta de entrevista da empresa WD

what is wrong with a code in C, and how to improve it

Resposta da entrevista

Sigiloso

18 de fev. de 2021

the problem was the function returned a pointer to an array created into the function itself, which will come back empty (because all the function's variables are deleted when it's finished), and the array was only in size of 100. The solution is to define a malloc into the main and send a pointer to the function to fill.