Archived

This topic is now archived and is closed to further replies.

TeraByte

Can someone help me with my code

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites