#include <iostream>
using namespace std;
void g();
int main() {
void g();
system ("PAUSE");
return 0;
}
void g(){
cout <<"hi there";
}
I'm just playing around trying to get the hang of void, but when I run it it doesn't output hi there. What am I doing wrong?
This line of code: void g();
means "there exists a function called g that takes in no parameters and returns none. It does not call the function, just states that the function exists.
While I'm here, this system ("PAUSE");
is a terrible habit to get into.