reading UTF-8 character from stdin

monkyyy crazymonkyyy at gmail.com
Tue Aug 5 13:26:21 UTC 2025


On Tuesday, 5 August 2025 at 12:15:40 UTC, Zoda wrote:
> Hi i need to read exactly one character from stdin, but i could 
> not found a proper way of doing it, how can i do that?

id probably just do

```d
import std;

void main(){
	foreach(dchar c;stdin.byLineCopy.map!(a=>a.array).joiner){
		c.writeln;
	}
}
```
Everything will be fairly hacky


More information about the Digitalmars-d mailing list