+ 1

What else I can use in place of int main, l(like int,float,etc.) which work in my this code and in 'C' language

What else I can use in place of int main, l(like int,float,etc.) which work in my this code and in 'C' language https://sololearn.com/compiler-playground/cWEDkp986LaY/?ref=app

13th Dec 2023, 4:44 PM
Viraj Yadav
Viraj Yadav - avatar
3 Answers
+ 2
You should check - the C language standard - the compiler documentation You can find a good summary here: https://stackoverflow.com/questions/2108192/what-are-the-valid-signatures-for-cs-main-function Every source is in agreement that the return type of the main function should be int.
13th Dec 2023, 4:57 PM
Tibor Santa
Tibor Santa - avatar
+ 2
you don't have to alter int main(){}. It's just the entry point of your program. What's important is the contents inside it.
15th Dec 2023, 11:44 AM
Bob_Li
Bob_Li - avatar
+ 1
Afaik int and void, void isn't commonly used now though. Void meaning the program doesn't 'return' anything. Int is used as a way to indicate the outcome of the program, 'return 0' meaning successfully executed and exited and any other number meaning that the program didn't execute successfully.
13th Dec 2023, 4:55 PM
Mohammed shoaib