Quick Question

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2006
Posts: 33
Reputation: Woobag is an unknown quantity at this point 
Solved Threads: 0
Woobag Woobag is offline Offline
Light Poster

Quick Question

 
0
  #1
Jun 17th, 2006
Im used to programming in Java as it was my first language to learn.

In C++ is...

  1. int myFunc(void);
equal to

  1. int myFunc();

I was doing a number of tests, but the answer was still unclear...
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 244
Reputation: Drowzee is an unknown quantity at this point 
Solved Threads: 5
Drowzee Drowzee is offline Offline
Posting Whiz in Training

Re: Quick Question

 
0
  #2
Jun 17th, 2006
The first version you posted is explicit, and, in my limited experience, is unnecessary.

Just use the second version if you have no input arguments; there's no difference.
Explainer of control logic and some basics.
"If you seek to drink from a fountain of knowledge, make sure your cup is big enough."
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,380
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 242
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Quick Question

 
0
  #3
Jun 17th, 2006
Originally Posted by Drowzee
The first version you posted is explicit, and, in my limited experience, is unnecessary.

Just use the second version if you have no input arguments; there's no difference.
There is a difference between the two in C or C++.
http://david.tribble.com/text/cdiffs.htm#C99-empty-parm
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 244
Reputation: Drowzee is an unknown quantity at this point 
Solved Threads: 5
Drowzee Drowzee is offline Offline
Posting Whiz in Training

Re: Quick Question

 
0
  #4
Jun 17th, 2006
Good to know. Thanks, Dave!
Explainer of control logic and some basics.
"If you seek to drink from a fountain of knowledge, make sure your cup is big enough."
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC