How can I write my own input function?

We know that all standard input functions expect '\n' as delimiter. Can I write a function that can ask the user which delimiter to use in place of '\n'? So it would read from the buffer until it reaches that character, exactly like cin would until it saw a '\n'.

Similarly can I write a function to I extract JUST ONE character from the buffer?

Relatively new to C++ would appreciate tips.
std::getline overload (2) : extract characters until a specified delimiter character is encountered
https://en.cppreference.com/w/cpp/io/basic_istream/getline

std::istream::get overloads (1), (2) : extract one character from the input buffer
https://en.cppreference.com/w/cpp/io/basic_istream/get
Thanks a lot JLBorges!
Appreciate it!
Topic archived. No new replies allowed.