a question related to void

L

liux

I found this sentence in MSDN:
When used as a function return type, the void keyword specifies that the function does not return a value.
Note that "does not return a value".
And I know that Classes have a special member function called a constructor. The constructor can take parameters as needed, but it cannot have a return value.
Here is the question:
Why could not I use void when declare a constructor?
 
N

Nindi

I found this sentence in MSDN:
When used as a function return type, the void keyword specifies that the function does not return a value.
Note that "does not return a value".
And I know that Classes have a special member function called a constructor. The constructor can take parameters as needed, but it cannot have a return value.
Here is the question:
Why could not I use void when declare a constructor?

I think the compiler already knows its a constructor so void would be
redundant infomation. Also I think actualy behind implicitly the
constructor does return something, a new instant of the object ;
 
J

James Kanze

Why could not I use void when declare a constructor?

Because the standard says so.

In the end, that's really the only reason. The standard
specifies a very special syntax for constructors, and that's the
syntax you have to use. It could have specified something else,
and then you'd have had to use something else. But any way you
look at it, constructors are not just everyday, run of the mill
functions, and need a special syntax.
 
D

Default User

liux said:
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD>


Fix your newsreader (Outlook Express, of course) settings so that it
stops using HTML.




Brian
 
J

Joseph Alten

liux said:
Sorry,what model dose most people use when they send and receive news?
text or html?

The standard for usenet is plaintext. Many people's readers cannot
handle the HTML/XHTML some people post, thus turning your post into an
unreadable mess. If you haven't already, turn off your client's HTML
mode (I'm assuming you use Outlook, if not, poke around in your settings):
http://support.microsoft.com/kb/883257

Thanks.
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,802
Messages
2,569,661
Members
45,430
Latest member
ShaniW735

Latest Threads

Top