0
Why we cannot use voide at place of int in c++language
11 Antworten
+ 10
The return value of main() is the exit code of the program. This is universally 0 for a "normal" exit and non-zero for abnormal. An int was chosen as the simplest data type with broad cross language compatibility.
+ 2
If you are looking at old books or old code examples and it shows void main its out of date. Microsofts Visual C++ compiler used to allow it but it has never been a part of C++ to allow the use of void main and will not work on any newer compiler.
+ 1
you can write void functions in c++
0
ok
0
but it shows error
0
ok
0
thanx
0
i get it
0
oh means we use void only in function
0
ok
0
ok