OneBite.Dev - Coding blog in a bite size

declare a void function without return value in C

Code snippet on how to declare a void function without return value in C

  void myFunction() {
    //code to be executed
  }

This code declares a function called “myFunction” without any return value. The function is declared using the keyword “void”, which states that there is no return value. Inside the curly braces, the programmer can put whatever code is necessary for this function. This code will be executed whenever the function is called. So, when the function is called, it will run the code inside the curly braces and then return, without returning any value.

c