0
int main()
after the "main", why there are 2 parentheses whithout anything inside?
2 Answers
+ 6
Parentheses are used to indicate functions and methods. They serve as containers for code that does a certain task.
If the function/method needed any information to be given to it, it would be defined inside those parentheses.
main() is your starting point, and also the first "task" your code performs. You'll learn how to write your own functions and methods later on.
- 1
int main (int argc, char *argv[]) { // This signature can be used to retrieve command line parameters in C++ depending on your compiler
}