Why is typeof(readln) -> void?

blizzard bliz at zar.d
Sat Jul 18 09:14:35 UTC 2020


```
import std.stdio;

void main()
{
     writeln(typeof(readln()).stringof); // string
     writeln(typeof(readln).stringof); // void
}
```
Can anybody explain the difference between readln() and readln? I 
read somewhere that the () were optional, so why this difference?


More information about the Digitalmars-d-learn mailing list