Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Types point2D and colorA [4/8]

The function linewp draws a line of a given width. The endpoints of the line are given by the first two arguments of type point2D, and line width is the third argument. The fourth argument is optional, it specifies the color.

The signature of this function is:

  • void linewp(
    • point2D p1,
    • point2D p2,
    • num lineWidth,
    • /colorA cl
    • )

The keyword void at the beginning of the signature indicates that this function does not return a value.

The forward slash / indicates that the parameter cl is optional. While the same symbol (slash /) is also used for named initializers of type color (like /blue and /yellow), these two usages of the slash symbol are unrelated.

Loading...