Formatted input from text file

IK istvan.karolyi at rocketmail.com
Mon Jun 18 01:34:16 PDT 2012


I'm attempting Project Euler's problem 11.
http://projecteuler.net/problem=11

Currently, my code looks like posted below, and it gives
    object.Error: Access Violation
at runtime.

Question: how to read that grid from a text file? (See link above.)
If you have ideas for using something other than uint[20][20], please say.
Thank you.

import std.stdio;
import std.stream;

void main()
{
	uint[20][20] grid;
	BufferedFile input_file;

	input_file.open("p011_input.txt");
	input_file.readf("%(%(%d %)\n%)", grid);
}


More information about the Digitalmars-d-learn mailing list