PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] getChar() vs nextLine() in pset 3
Date: Monday, 24 Feb 2020, 20:00:48


    > Message Posted By: Unknown
    >
    > Why do we have to use nextLine() instead of getChar() for standard input
    > in pset 3?

I assume that you meant getline() and getchar() above.

strwrs must read lines of unknown length, which is just
what getline() does.  Thus having you write similar code
using getchar() and realloc() would be like having you
write code for strlen().

--Stan-
PREV INDEX NEXT