Void

Posted By: sydan

Void - 05/15/09 12:50

The term 'void'. I'm guessing this is a lite-c function.
What is it for? Its not in the manual. How is it used?
Posted By: Widi

Re: Void - 05/15/09 12:54

"void" is the same as the "function". But by the void you don`t can return a parameter. I think void is a little bit faster then function (?)
Posted By: Saturnus

Re: Void - 05/15/09 13:04

void ist a data type that holds no data.
If it is used as a return type for a function, it implies that the function doesn't return any value.

A void pointer however is something different. It can point to any type of data.
Posted By: Quad

Re: Void - 05/15/09 13:12

void is not a lite-c thing, it's a c/c++ type that is "nothing".

when you are defining functions you use a keyword before functions name to state what it returns.

like by using int in this function definition

int square(int a){
return a*a;
}

you say that , this fucnition will return a int. if your function doesn't return anyting, then you use void. and from what i can remember "function" and "action" are typedefd to void.

However in lite-c as Kombucha said, there is that void pointer thing that can point to any type of data(because all pointers are in same size, in void pointer you dont specify what type of object/type it points to, it can point any type of type/struct.)
Posted By: EvilSOB

Re: Void - 05/15/09 13:35

action is a void type, but function a VAR type
Otherwise I Quadraxas is right, to the best of my knowledge.
Posted By: sydan

Re: Void - 05/15/09 16:57

Hey thanks guys.
© 2024 lite-C Forums