learning D. Experienced issue very quickly.
Mark
section91 at yahoo.com
Wed Apr 18 06:10:46 PDT 2012
Yeah I bought the book recently and ran into an issue very
quickly into it. But this error I keep getting keeps bugging me.
Could really use an explanation on why its not compiling. Here is
the code.
/*
Compute heights in centimeters for a range of heights
expressed in feet and inches
*/
import std.stdio;
void main() {
// values unlikely to change soon
immutable inchPerFoot = 12;
immutable cmPerInch = 2.54;
// loop'n write
foreach (feet; 5 .. 7) {
foreach (inches; 0 .. inchPerFoot) {
writeln(feet, "'", inches, "''\t",
(feet * inchPerFoot + inches) * cmPerInch);
}
}
}
Here is the error I keep getting every time I try to compile:
(13): found '..' when expecting ')'
(13): found ')' when expecting ';' following statement
(14): found '..' when expecting ')'
(14): found ')' when expecting ';' following statement
More information about the Digitalmars-d-learn
mailing list