Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Can we use the char main() as a return function.

+1 vote
asked Sep 13, 2021 by Mukul Kumar (130 points)

3 Answers

0 votes
answered Sep 19, 2021 by Rahultomer126 (140 points)
yesss you can do
0 votes
answered Sep 20, 2021 by Peter Minarik (86,040 points)

It depends on the C (or C++) compiler (and the enabled compiler flags). The compiler used by OnlineGDB allows you to do that.

But why would you want to do that in the first place? What is wrong with int, the default return value?

0 votes
answered Oct 7, 2021 by MOHIT SETHIYA (140 points)
yes we can return a char in main() function by using char main()
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...