Why can't I use void main in c++
This is because the C++ standard requires main() to return int. As you probably know, the return value from the main() function is used by the runtime library as the exit code for the process. Both Unix and Win32 support the concept of a (small) integer returned from a process after it has finished. Returning a value from main() provides one way for the programmer to specify this value. If the code runs with no error then 0 is returned by the main()
It has to do with the state of the compiler after the execution. 0 means normal termination while 1 means abnormal termination. Since the compiler needs to know the status of the code it uses the returned 0 or 1, which are of type int. It can return 1 as well, btw, AJ || ANANT || AC || ANANY || AY
Because in C++ main method always return 0. That's why. It's predefined. Edited: In c++ main method either return 0 or 1.
AJ || ANANT || AC || ANANY || AY Main function in C++ does not always return 0.
Hajji_firas Abnormal termination is just a big word for "I don't think the code is working fine..." Normal termination is like "Everything is under control, even if something goes wrong"
What is the difference bitween abnormal and normal code do you have an example for both
You can use void main in different compiler like turbo, dev etc. But you have to use getch with it conio header file.
Can you give me a example of call by volue now
Ashu Singh Baghel Don't ask here. Ask in seperate thread so people can give answer.