F
fadics
0;
The above sentence can be compiled. What does it mean? Why C++ can compile
such sentence?
The above sentence can be compiled. What does it mean? Why C++ can compile
such sentence?
fadics said:0;
The above sentence can be compiled. What does it mean?
Why C++ can compile
such sentence?
"Compute the expression '0'". It does nothing other than place some
code in the way.
The C++ grammer allows it.
It just does !
fadics said:0;
The above sentence can be compiled. What does it mean? Why C++ can compile
such sentence?
Alf said:We have "functions" that return "void". And we have not only
conceptual problems because of that, but also technical ones
such as overloading. In short, it indicates a language that
evolved more than was designed, and like our own human bodies
therefore has many nonsensical constructs.
You think there is something wrong with having a function
that returns void ?!
In message said:The definition of a function is something that maps an input to the
corresponding output...
It's a mapping from one set to another set. Nothing there says that theThe void return is not a function because of
this technicality.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.