Is there any way to read characters that satisfy certain conditions only from stdin in C++?
<p>I am trying to read some characters that satisfy certain condition from <code>stdin</code> with <code>iostream</code> library while leave those not satisfying the condition in <code>stdin</code> so that those skipped characters can be read later. Is it possible?</p>

<p>For example, I want characters in <code>a-c</code> only and the input stream is <code>abdddcxa</code>.</p>

<p>First read in all characters in <code>a-c - abca</code>; after this input finished, start read the remaining characters <code>dddx</code>. (This two inputs can't happen simultaneously. They might be in two different functions).</p>
