Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Puzzle

Reply
Thread Tools

Puzzle

 
 
Ramanathan
Guest
Posts: n/a
 
      09-04-2004
What is the difference between the following declarations?
void funct();
void funct(void);
I guess there is definitely a difference between them.
 
Reply With Quote
 
 
 
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      09-04-2004
Ramanathan wrote on 04/09/04 :
> What is the difference between the following declarations?
> void funct();


This is a function declaration. It indicates the name of the function
and the return type, but nothing about the type and number of
parameters (unspecified). It's usage is not recommended.

> void funct(void);


This is a detached function prototype that indicates the name of the
function, the return type, and that the function accepts no parameters
at all.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"C is a sharp tool"

 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      09-04-2004
"Ramanathan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> What is the difference between the following declarations?
> void funct();


Declares a function which doesn't return anything,
does not specify what parameters it has.

> void funct(void);
> I guess there is definitely a difference between them.


Declares a function which doesn't return anything,
specifies that it has no parameters.

Aside: In C++ the two are equivalent.

-Mike


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the extra bar along top in v1.5 with puzzle image? Can we get rid of? S.Rodgers Firefox 9 12-14-2005 11:15 AM
Home networking puzzle?!? =?Utf-8?B?Qm9ya28=?= Wireless Networking 3 01-25-2005 06:49 AM
A NS puzzle:) Brad Snow Firefox 6 09-03-2004 04:54 AM
A puzzle to puzzle you sk A+ Certification 1 07-17-2004 05:19 PM
PUZZLE Getting DropDownList Index of Matching Value Earl Teigrob ASP .Net 3 08-06-2003 09:41 PM



Advertisments