In int main(), and a lot of other things the user puts two parentheses afterwards side by side, what is that for? Every tutorial and everything I've read has never explained it at all.. Thanks a lot guys.
It means it's a function. (ie. a separate block of code w/ a name) And use them when calling a function.
Originally Posted by abuckau907
It means it's a function. (ie. a separate block of code w/ a name) And use them when calling a function.
Ah, so simple. Thanks a lot.
Just so you understand more ...
When you call a function, you can send it a variable.
For instance, I could call add(1, 2). The function would return 1 + 2.
Now, imagine you want to call a function but you don't want to send it anything, you would send it "void" : sayhi(void). Void being nothing.
when you write sayhi(), its like writing sayhi(void), but simply faster.
the parenthesis aren't there for no reason.
And, FYI, int main() should usually be int main(int argc, char *argv[]) so you can use the arguments supplied to your program.