point::point

Description

constructor which initializes a point object from x and y coordinates


Copy constructor which initializes the point object from another point object

Syntax

point( int x = 0, int y = 0 )

point( point pp )

Parameters

x
[input](optional) x coordinate
y
[input](optional) y coordinate

pp
[input]source point object

Return

Examples

EX1

void point_point_ex1()
{
    point    pt(4, 7);
    
    printf("x = %d   y = %d\n", pt.x, pt.y);
}


EX2

void    point_point_ex2()
{
    point    pt(4, 7);
    
    // Initialize pt2 from pt:
    point    pt2(pt);
    
    // Display pt2:
    printf("x = %d   y = %d\n", pt2.x, pt2.y);
}

Remark

See Also

header to Include

origin.h