Quote:
Originally Posted by Salem
Code:int *fchar(char buf[], FILE *stream, size_t size)
{
int i = 0;
while (i < size - 1)
buf[i++] = fgetc(stream);
while (buf[i--] != '\n' && i > 0)
;;
buf[i+1] = '\0';
return 0;
}
unistd.h is for 'exit()', I also forgot to 'close()' the file.Quote:
>#include "/Source/str.h"
Adding unistd.h made otherwise portable code less portable. What on earth is this for?
I'm just playing with C.
{edit}