Crash when adding public variable
===

I have a rather large c++ program including a class "Character". In "Character.h" first the struct CharacterSettings is declared, and then the class Character (including their constructors).

Character has (among others) a CharacterSettings* settings and a Point pos.
CharacterSettings has a Point preferredVelocity.

This works fine.

However, when I add any public variable to Character, the program crashes when I call this:

    drawLine(character.pos, character.pos+character.settings->preferredVelocity, character.radius/3.0, 128, 80, 0);
				

The program crashes on this line:

    Point operator + (const Point &p2) const
    	{ return Point(x + p2.x, y + p2.y); }

I assume it's trying to do character.pos+character.settings->preferredVelocity. The error message I get is 

    Unhandled exception at 0x004bc4fc in ECMCrowdSimulation.exe: 0xC0000005: Access violation reading location 0x7f80000f.

When I look at it, p2.x and p2.y are undefined. Without the extra variable, they aren't. I have absolutely no idea what is happening, how to even begin debugging or what information you would need to help me! Any help would be greatly appreciated!