what is wrong with a code in C, and how to improve it
Anonymous
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.
Check out your Company Bowl for anonymous work chats.