16.11.2014 Views

struct point

struct point

struct point

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Пример<br />

<strong>struct</strong> <strong>point</strong> {<br />

int x;<br />

int y;<br />

};<br />

//ново име на типът <strong>struct</strong> <strong>point</strong> - Point<br />

typedef <strong>struct</strong> <strong>point</strong> Point;<br />

typedef <strong>struct</strong> rect {<br />

<strong>struct</strong> <strong>point</strong> pt1; //възможни са и двата варианта<br />

Point pt2;<br />

} Rectangle; //ново име на типът <strong>struct</strong> rect - Rectangle<br />

Използваме новите имена:<br />

Rectangle makeRectangle (Point pt1, Point pt2);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!