Hey guys, I've made a function to return a string of char, however when i call the function I'm only getting the 1st char back. How can i read the whole string?
char *get_line (FILE *fp)
{
char *string = malloc(10 * sizeof (int));
->Code <-
return string;
}
To access it I write
line = get_line(pfile);
Any suggestions would be helpful, ive read C is not so good at returning strings, but that's the way the function has to work eek