what void mean in c language like
int main(void){
}
or some function
like void myfun(void)
thanks
int main(void){
}
or some function
like void myfun(void)
thanks
thanks very much ,can you please simplify for me by like example i am new in c languagemyfun(void) means there are no parameters to pass to the subroutine.
void myfun(xxx) means there is no result returned from the subroutine.
The key to understanding this is that, unlike mathematical functions, program functions in many/most languages do a lot more than take values as arguments and return values as results. Because they can do other things, it is not always necessary for them to take any values as arguments and/or return values as results.thanks very much ,can you please simplify for me by like example i am new in c language
void Greetings(char *s)
{
printf("Greetings, %s\n", s);
}
double RandNorm(void)
{
return (double) rand()/ (double) RAND_MAX;
}
That would be any ANSII C compiler.Some compilers allow you to omit the word void.
void foo();
...
void foo()
{
// code here
}
While a pointer may be cast as a void pointer (or even declared as one), it can't be cast as a void. These are two very different things. I don't know what casting something as a void would even mean (so perhaps I am missing something -- always possible).A pointer may also be cast a void. A pointer typically points to a certain type of object, such as a character or an integer. A void pointer may point to any type.
by Duane Benson
by Duane Benson
by Jake Hertz