PDA

View Full Version : int - void????



01-17-2004, 03:06 PM
I am a complete ogl newb and c++ newb for that matter. Anyway why when the drawgl section of the code is contained in an "int" thing as opposed to a "void" thing - it allows you to return true;

nexusone
01-17-2004, 05:40 PM
Hum... not sure what you are asking?

Here is some examples of routine and return values.

void MyVoid( void )
{
Do something
}

Myvoid(); We are sending no variables and not getting anything in return.

void My_input( int input)
{

if (input == something) do_something();

}

My_input( 42 ); We send it a number to do something, but expect nothing in return.

int My_input_output( int input )
{
int output;
output = input * input;
return output;
}

result = My_input_output( 2 ); We send a number in and get a number out. In this case result will have 4 returned to it.

Hope this helps... next time please do not ask non-openGL related questions in this forum, but find a C/C++ forum for it.



Originally posted by dmf_king:
I am a complete ogl newb and c++ newb for that matter. Anyway why when the drawgl section of the code is contained in an "int" thing as opposed to a "void" thing - it allows you to return true;

mikael_aronsson
01-17-2004, 11:47 PM
Hi !

If you have a news reader there are lots of places to get help on C/C++.
http://www.physics.drexel.edu/courses/Comp_Phys/General/C_basics/c_tutorial.html

Is a pretty ok C tutorial that might help.

If you try www.google.com (http://www.google.com) and enter
"C tutorial" or "C++ tutorial" you will find lots of helpful information.

Mikael