help please, few questions...

Started by
3 comments, last by Rome 21 years, 2 months ago
edit: I was meaning to copy everything above and put it into the beginners section, sorry. I have some things that I need to finally ask because I simply haven't figured them out as a beginner programmer since I started. I would really appreciate any feedback on any of the questions. Some relate to openGL. 1) I like things neat and need to add a call to my drawcube() (don't know how you call them... functions?) from the drawscene part "where all the drawing is done" but the drawcube() is in another .cpp file. I included a .h file with it inside and linked both files along with the drawcube() in drawscene, but it doesn't work. I get... error : missing ';' before type 'void' error C2501: 'WINGDIAPI' : missing storage-class or type specifiers fatal error C1004: unexpected end of file found All when double clicked go to the line WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value); in GL.h 2) Is there any difference between blah(void) and blah() ? 3) Is there any difference between 'if(blah == 1 || blah == 2)' and 'if(blah == 1 && blah == 2)' ? 4) How do I do the above except instead of 'and' do 'or', where 'and' is || and && ? 5) Are bools default to true? 6) Will return 0; stop doing what where? As soon as the line is done or what? 7) I've read some tutorials and still don't know how to use getch(); They don't really explain it in any. 8) Is there an easy way to put color into a dos window. [edited by - Rome on January 23, 2003 6:36:52 PM]
Advertisement
I can answer a few of those... Hope you stay motivated, you''ve got a lot coming at you

2) no, there isn''t

3) yes, that''s a big difference "||" is a logical OR, meaning that it would go into the if-part, if either the left or the right condition is TRUE. "&&" is the counterpart to OR.. it''s a logical OR. so, the example you gave would be nonsense, since blah can never be 1 AND 2 at the same time.

5.) variables aren''t initialised. to actually, you cannot say wether they''re true or false before being initialized. So, always initialize your variables

6.) everything up to and the return statement is executed. everything below return isn''t. but note, that return foo(); will execute foo() and return foo()''s return variable...

Those are the one''s that I think I have good explanations for...
hope that helped!
cya,
Phil

Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this question a few times over in the states )
Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this question a few times over in the states ;) )
I was hoping people wouldn''t think blah on the left and right were the same thing, let''s say ''blah1 || blah2'' and ''blah1 && blah2'' instead.
Hey,

#include <windows.h> before all of your OGL libraries and headers

Michael Bartman
Dark Omen Studios
thats for the

error : missing '';'' before type ''void''
error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found

errors

This topic is closed to new replies.

Advertisement