Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

The Type color [6/11]

This program contains an error.

The variable un is introduced in the first statement. The value of this variable is not set. More precisely, this variable is uninitialized.

This variable cannot be used until it is initialized.

A variable of type color is initialized when all three members are initialized.

One member of variable un is uninitialized.

Correct the error by initializing the missing member and run the program.

Solution (click):

un.r=80;
un.g=22;
un.b=0;

(Note: in place of 22, any number in the range 0-100 is OK.)

Loading...