In C! Did anyone used char main () ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In C! Did anyone used char main () ?

30th Jul 2017, 2:29 PM
Meeom
Meeom - avatar
2 Answers
+ 5
No, char has never been declared as a return type for main(). As for why only int (or void, as in C in the past, supported by some compilers) have been used as main's return type: https://softwareengineering.stackexchange.com/questions/203104/why-cant-main-return-a-double-or-string-rather-than-int-or-void
30th Jul 2017, 3:08 PM
Hatsy Rei
Hatsy Rei - avatar
0
Yup! Everyone goes with int or void 😉😉
30th Jul 2017, 3:12 PM
Meeom
Meeom - avatar