"string" data type with readln

Adam D Ruppe destructionator at gmail.com
Mon Jul 25 20:19:26 UTC 2022


On Monday, 25 July 2022 at 19:55:40 UTC, pascal111 wrote:
> I tried to type small program, and tried to use "string" data 
> type with "readln", but the compiler refused it, and I had to 
> use "char[]".

the overload you used modifies the array you give it

try

string s = readln();



More information about the Digitalmars-d-learn mailing list