newbie: Access violation because of "class"

Larry Luther larry.luther at dolby.com
Thu Apr 29 18:50:41 PDT 2010


Why do I get an "object.Error: Access Violation" in the following code?
If I change "class" to "struct" and remove "public:" I don't get an error.
I'm using D2.

import std.stdio;

class Plane {
  public:
    int
      xres,
      yres;
};


void main (string[] args) {
 Plane
  p;
  p.xres = 1920;
}







More information about the Digitalmars-d-learn mailing list