What is the difference between int main and void main | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference between int main and void main

16th Jan 2021, 6:39 AM
亗ᴄᴏᴅᴇᴘʟᴀʏᴇʀ⁸⁶
亗ᴄᴏᴅᴇᴘʟᴀʏᴇʀ⁸⁶ - avatar
2 Answers
+ 1
Md. Tamim Iqbal int and void are return type. int returns integer value and void returns nothing.
16th Jan 2021, 7:23 AM
A͢J
A͢J - avatar
+ 1
int main(void) { } is standard C and void main(void) { } is not - except in a few very rare cases. The return value is there to signal to the operating system if the program ran successfully or if it failed to execute.
16th Jan 2021, 1:45 PM
Mike A
Mike A - avatar