May 18, 2007 Small readln problem | ||||
|---|---|---|---|---|
| ||||
Im having some starting trouble, using the code from the srd.stdio spec :
/*BEGIN CODE*/
import std.stdio;
int main()
{
char[] buf;
while ((buf = readln(stdin)) != null)
writef("%s", buf);
return 0;
}
/*END CODE*/
Im getting the following errors
>>dmd test
test.d(6): Error: undefined identifier readln
test.d(6): Error: function expected before (), not readln of type int
test.d(6): Error: cannot implicitly convert expression (readln((& _iob))) of type int to char[]
Im running a Windows 64bit machine if that helps.
| ||||
May 18, 2007 Re: Small readln problem | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Bradley | Bradley wrote:
> Im having some starting trouble, using the code from the srd.stdio spec :
> /*BEGIN CODE*/
> import std.stdio;
>
> int main()
> {
> char[] buf;
> while ((buf = readln(stdin)) != null)
> writef("%s", buf);
> return 0;
> }
> /*END CODE*/
>
> Im getting the following errors
>
>>>dmd test
> test.d(6): Error: undefined identifier readln
> test.d(6): Error: function expected before (), not readln of type int
> test.d(6): Error: cannot implicitly convert expression (readln((& _iob))) of type int to char[]
>
> Im running a Windows 64bit machine if that helps.
readln() was introduced in dmd 1.010, make sure you're not using an older version.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply