struct pixelcolor int r g b pixelcolor black blackr 0 bla

struct pixel_color

{

int r, g, b:

}

pixel_color black;

black.r = 0;

black.g = 0;

black.b = 0;

I get the error \'black\' does not name a type

what am I going wrong??????

Solution

struct pixel_color

{

int r, g, b;

}

pixel_color black;

black.r = 0;

black.g = 0;

black.b = 0;

/*In the structure declaration keep semicolon instead of colon*/

struct pixel_color { int r, g, b: } pixel_color black; black.r = 0; black.g = 0; black.b = 0; I get the error \'black\' does not name a type what am I going wro

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site