function of in c++ code example
Example 1: functions in C++
void Hello() {
std::cout << "Hello";
}
int main () {
Hello();
}
Example 2: function in c++
#include <iostream>
using namespace std;
// Create a function
void myFunction() {
cout << "I just got executed!";
}
int main() {
myFunction(); // call the function
return 0;
}
// Outputs "I just got executed!"