Skip to content

Commit

Permalink
fix samples/wc2.d so it compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Apr 13, 2017
1 parent ac3225a commit e9c53dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions samples/wc2.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import std.stdio;
import std.stream;
import std.file;

int main (string[] args)
{
Expand Down Expand Up @@ -52,13 +52,13 @@ int main (string[] args)
}
else
{
auto f = new BufferedFile(arg);
auto f = std.stdio.File(arg);
string buf;

while (!f.eof())
{
char c;
f.read(c);
f.readf("%c", &c);

if (c == '\n')
++l_cnt;
Expand Down Expand Up @@ -109,7 +109,8 @@ int main (string[] args)

writefln("--------------------------------------");

foreach (word1; dictionary.keys.sort)
import std.algorithm;
foreach (word1; dictionary.keys.sort())
{
writefln("%3s %s", dictionary[word1], word1);
}
Expand Down

0 comments on commit e9c53dd

Please sign in to comment.