0
Why can't we use void main insted of int main as taught in our school
5 Respuestas
0
I don't know why your school teaches that, becaude void main doesn't work in the first place in c++ as the main function.
What IDE does your school use? Are you sure your school is teaching c++ and not somrthing like java?
0
I think that may be Java
0
Even in our skl they use void main as in the beginning for easy programs the return function is not needed. So void main is sufficient for all beginner programs
0
void main is applicable in both java nd c++. in java u hv to define it with a static variable where as it is not the same in c++. Its like in java :- "public static void main" were as in c++ its just void main. I hv been usong bth of them, java in school nd c++ in college now
0
A lot of issues between IDE's. Some allow void, others do not. Void is typically meant for Java, but some IDE's that can run Java OR C++ have some crossing that causes confusion.