-
Contributing Member
Can void be the return value of main Function
Is it possible to declare the main() as void. Will this declaration of main function as void give me error? Someone who has experienced throw highlight on this.
-
Expert Member
Re: Can void be the return value of main Function
It is not possible to declare main() function return value as void. This is because the default return value of main function in C is int and if one declares it as void it results in mismatch in declaration and so cannot be declared as void.
-
Contributing Member
Re: Can void be the return value of main Function
It was a nice explanation so is it that if one declare void in main() the program would throw redeclaration error that is a compile time error.
-
Junior Member
Re: Can void be the return value of main Function
void main() works in the TC compiler but not in cc. why?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules