+ 1

Why int is used before main() in hello world. It's not an integer though. ?

18th Dec 2018, 12:16 PM
Aditya Rathore
Aditya Rathore - avatar
4 Antworten
+ 3
I think yes. But his question is about the int before main() and that's what I explained him. . . Please correct me where I am wrong.
18th Dec 2018, 12:26 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 2
A function always have a return type. By return type I mean that every function may return some value. Return type specifies that what is type of value that is returned. You can also use float, double etc in place of int. Void return type stands for no return. Hope this make sense.
18th Dec 2018, 12:21 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 2
Good initiative, Raj Chhatrala. Only if you don't mind me clear two things : 1. A function can have no return value, and such function is declared as void. 2. The question is asking about main()
18th Dec 2018, 12:23 PM
Gordon
Gordon - avatar