I'm trying to make a brief header function for getline() (called "linein") so that I can go:
Only I would like to include the stream, so instead the second line could be:Code:char *line; line = linein();
This is what the function I wrote looks like:Code:line=linein("stdin");
This compiles fine and actually runs, but the line returned contains nothing (nor does it test as "== NULL").Code:char *linein (char *stream) { int len=0; char *line; line = NULL; getline(&line,&len,&stream); return line; }
The problem is obviously to do with passing a "stream" argument to getline. Is there a proper way?



LinkBack URL
About LinkBacks




