I tried searching for something to help me on this but with no luck, so here goes my question. I am trying to pass a struct by reference (because it seems like the right thing to do) and I get no compilation errors however when the function gets called my app crashes immediately. Here is what I have.

Function Declaration
PHP Code:

void drawline
(POINT *, POINT *); 
Function code
PHP Code:

void OSDC
::drawline(POINT *pt1POINT *pt2)
{
 
POINT pts[1];
 
 
pts[0] = *pt1;
 
pts[1] = *pt2;
 
 
Polyline(hDC, &pts[0], 2);
 

usage
PHP Code:

POINT pt1
pt2;
           
pt1.0pt1.0;
           
pt2.10pt2.20;
           
o.setlinecolor(RGB(015255));
           
o.drawline(&pt1, &pt2); 
Thanks in advance.