943,776 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1314
  • C++ RSS
Jun 17th, 2006
0

Quick Question

Expand Post »
Im used to programming in Java as it was my first language to learn.

In C++ is...

C++ Syntax (Toggle Plain Text)
  1. int myFunc(void);
equal to

C++ Syntax (Toggle Plain Text)
  1. int myFunc();

I was doing a number of tests, but the answer was still unclear...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Woobag is offline Offline
33 posts
since Jun 2006
Jun 17th, 2006
0

Re: Quick Question

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.
Reputation Points: 22
Solved Threads: 5
Posting Whiz in Training
Drowzee is offline Offline
244 posts
since Jul 2005
Jun 17th, 2006
0

Re: Quick Question

Quote 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
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004
Jun 17th, 2006
0

Re: Quick Question

Good to know. Thanks, Dave!
Reputation Points: 22
Solved Threads: 5
Posting Whiz in Training
Drowzee is offline Offline
244 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Won't Run
Next Thread in C++ Forum Timeline: Getting a non-random number?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC