The function is getch(), not getche(), unless there's one I don't know. The exercise probably calls for getche()so that the names don't conflict. You create the getche() function, and you don't use getline(). From what you wrote, you're supposed to write a function that does the same thing as getline().
Anyway, try putting getch()in a while loop that tests for the delimiter character.