using fgets to store something into an array silently?
I have the following piece of code:
Code:
void getString(char array[], int size)
{
printf("Please enter some text");
fgets(array, size, stdin);
}
I have a few other methods, arrayToLinkList and printLinkList. Basically when i pass the array to these methods it copies it into a linked list and another method prints it out.
My question is i have a file, i can print out the contents, i know how many lines are in it so reading the file and having a reference to it is no problem. How exactly do i extract the contents and store it in an array using fgets? Whenever i modify the above method it keeps asking for input.