944,156 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 3717
  • C RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 23rd, 2007
0

Anyone have a good programes..? PlZ

Expand Post »
I need someone help me and share a programe 2 me.Help me... ok... Peace..

thanks for your idea...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
HS20064972 is offline Offline
1 posts
since Jan 2007
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

you will have to be a tad bit more specific because there are millions of programs.:mrgreen:
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

you will have to be a tad bit more specific because there are millions of programs.:mrgreen:
That's just mean...
Here's a program for you:
  1.  
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6. return 0;
  7. }

I'm joking as you might have noticed :mrgreen:
Ancient Dragon is right, what do you want and what have you made so far?

Niek
Last edited by Nick Evan; Jan 23rd, 2007 at 11:20 am.
Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Nick Evan is offline Offline
4,132 posts
since Oct 2006
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

that's in fact an excellent program. It compiles, it runs, and all without errors.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

With the only problem being the wrong prototype of main....
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

I see nothing wrong with his main() -- argc and argv parameters are optional.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

I see nothing wrong with his main() -- argc and argv parameters are optional.
I guess he's talking about empty parameter lists being deprecated in C. And old C headers are deprecated in C++ so that program is somewhere in between C and C++.

But let's be serious and remember that the chances of either of those causing a problem are vanishingly small.
Reputation Points: 84
Solved Threads: 15
Posting Whiz in Training
Ravalon is offline Offline
209 posts
since Dec 2006
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

In C, when a function defination or declaration is followed by an empty pair of parentheses it means that zero or more parameters. So main when written as int main( ) in C can stand for int main( int, int, int ) or int main( void, void ) or whatever, whereas the standard specifically says that the prototype of main can only be either int main( void ) or int main( int argc, char** argv ). Hence the explicit void is required in case of pure C programs.

Whereas in C++ when a function defination or declaration is followed by an empty pair of parentheses it means it does not take any argument i.e. void. Hence the void can be safely omitted in C++.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

Click to Expand / Collapse  Quote originally posted by ~s.o.s~ ...
In C, when a function defination or declaration is followed by an empty pair of parentheses it means that zero or more parameters.
Only for a declaration. For a definition an empty pair of parentheses really does mean zero parameters.
Reputation Points: 84
Solved Threads: 15
Posting Whiz in Training
Ravalon is offline Offline
209 posts
since Dec 2006
Jan 23rd, 2007
0

Re: Anyone have a good programes..? PlZ

An extract from Google Groups:
Quote ...
A C program is not required to work right if its main function does not have one of these two types:

int main(void) { /*...*/ }
int main(int argc, char **argv) { /*...*/ }

Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006

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: Alignment printing with a (float)mat[][]
Next Thread in C Forum Timeline: Passing pointer address... Doubt!!!!





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


Follow us on Twitter


© 2011 DaniWeb® LLC