+ 3
Int main()
I understand what this means but I don’t understand why there is the () after it. I am pretty sure that I need it, I’m just wondering why
6 Réponses
+ 8
Christian0972 because "main" is a function and this is how a function should be defined
<Return type><function name>(<parameters>)
Int main()
Means "main" function will return integer value but will not need argument to be executed(or we can say that it will need "void" to be executed)
+ 5
Ace
Yes thats right i forgot to say that. I was only talking about the case when you dont want to use the arguments.
+ 4
the functions return an example sum value (int a, b) this function will return the sum of a and b the parenticis "()" main function indicates that they do not return any value in the sololean course c there are lessons about the functions
+ 3
Because this function has no parameter. Always when you define a function on your own without parameters you would also put () behind the name
+ 3
If you don't put, it becomes a variable. if you put, it refers to as a function, so a function should have (). A main() is also a function and starting point of program execution.
+ 3
Everything in c starts with main function ,we use paranthesis for function Syntax