Advertisement

Can someone help me with my code

Started by October 19, 2002 10:13 AM
2 comments, last by TeraByte 22 years ago
Heres a section of the code from program: typedef bool SGL_RESULT; const SGL_RESULT SGL_SUCCESS = true; const SGL_RESULT SGL_FAILURE = false; enum PIXELOPS { PO_set, PO_add, PO_redness, PO_greenness, PO_blueness, PO_greyness, PO_invert, PO_mix }; struct XY_RGB { int x, y; int R, G, B; }; SGL_RESULT DrawPixel(XY_RGB *data); // The next line caauses the error(s). SGL_RESULT DrawPixel (XY_RGB *data, PIXEL_OPS ops); ... When i try to compile i get thease errors: type specifier omitted for parameter parse error before `)'' And in the .cpp file: `data'' undeclared (first use this function) The first DrawPixel function works, but the overloaded one doesn''t. They both worked before i put all the parameters into a structure, so can someone tell me why this wont work? I''ve tried all i could think of... but no luck.
"Though i walk through the valley of the shadow of death, iwill fear no evil, for i am the meanest motherfucker in the valley."
Looks like your struct is called PIXELOPS, but you''re trying to call DrawPixel with a struct called PIXEL_OPS. Is that it, or was that intentional or a typo in your post?
Advertisement
Could you specify which lines the errors are for? Where do you declare data?

EDIT: Nevermind that last question.

[edited by - CWizard on October 19, 2002 12:01:56 PM]
Wow, i can''t believe i didn''t see that! Thanks!
I guess i must have accedentally deleted the underscore...
Its always the little things that cause most problems, isn''t it?

Anyway, that brings me to another question or two.

Firstly, ive been searching for articles but found but a few, so does anyone know of any good articles on optimization?

And lastly, does anyone know of any sites or articles to help me with Dev-Cpp inline assembly?
I found something a few weeks ago, and it said that gcc doesn''t use MASM/TASM style syntax like VC++ and i have no idea where to look for information... ive searched but...

Thanks.
"Though i walk through the valley of the shadow of death, iwill fear no evil, for i am the meanest motherfucker in the valley."

This topic is closed to new replies.

Advertisement