Function to insert text line by line from a file into string array passed by pointer
问题 I'm trying to create a function read_lines that takes a file *fp, a pointer to char** lines, and pointer to int num_lines. The function should insert each line of text into lines, and increase num_lines to however many lines the file has. Its probably really simple but I've been trying to insert the text for several hours now. This is what main.c would look like. Everything but read_lines is already defined and working. int main(int argc, char* argv[]){ char** lines = NULL; int num_lines = 0;