in c if we use main();
we donot get any error
but in c++ we have to mention the return type
can any one tell me why is this??
Printable View
in c if we use main();
we donot get any error
but in c++ we have to mention the return type
can any one tell me why is this??
C (well the C89 version at least) permits implicit declarations, so if you omit the type then int is assumed. In C99 (the new standard for C), this is no longer allowed, and you have to say what you mean.
C++ being more strongly typed than C from the outset never had the notion of implicit types.