0

A void function does not return any value as output and can take input values. The function below seems a void function, but there is the operator *, why?

void *function(){
     printf("hello")
}

1 Answers1

0

That is not a void function. That is a function that returns a void* (pointer). But it seems incomplete, because the printf() has no semicolon ; and the function does not actually return a void*.

DarkAtom
  • 2,589
  • 1
  • 11
  • 27
  • can you write an example to understand how to use it please? – Federica Guidotti May 19 '20 at 09:39
  • You have to study the pointers chapters. If you have a C book, it has to have a chapter about it. If not, just google it, this topic is far too complex to explain in a SO answer. – DarkAtom May 19 '20 at 09:41