In my C program this function is going to handle all the work of opening a specific file and then return the file pointer, so main or other functions can read the content by using fp, but so far i haven't been able to get this to work.
I'm just learning the language, so it is possible that i am doing something very wrong.
int open_text_file(char text_file_name)
if((fp = fopen(text_file_name, "r")) != 0)
printf("Cannot open file \"%s\"\n", text_file_name);
以上就是Return pointer from function C的详细内容，更多请关注web前端其它相关文章！