nitediver said:
when do we need using int main?
All of the time. 100% of every single time you make a program ever in C or C++.
main is required to return a value to the operating system, and granted many compilers will implicitly declare
main as int (some will
even accept it if you declare it as void), it should always be done explicitly, should always be
int, and you should always return 0 at the end when you're done, because
some compilers won't do all of this by themselves, and on other systems this will
actually cause you harm. Further,
it's simply good practice. There's no real reason not to, and it's much more painless to stick to the standards.
EDIT: Granted, I cited many articles that talked about
void main, there simply isn't as much information about main without a return type. Most of these articles address that as well.