Go to Post They knew that the number of gracious, professional, make-your-grandmother-so-proud-she-will-puke moments of exemplary behavior by the teams would far outshine any minor mistakes or incidents of less-than-perfect decorum. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 14-10-2004, 01:03
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Re: i would like your opinion on my programs

First of all, excellent work for someone just starting out with C. A few comments though to help make the transition from just playing with C to actually using it well:
First, unless you absolutely need to represent fractional numbers, you should always try avoid using doubles. They are _incredibly_ slow compared to ints. Since both factorial and permutations are purely integer functions, you would be much better off with simply using ints.
Second, code modularity is very good thing. If you have some time, I'd definately try re-writing your programs so that factorial is a function that you can call from within your permutation program. This idea of re-usable code and breaking things into smaller functions is the key to really using C well.
Third, global variables are a bad thing (unless you've got a darn good reason for using them). You can easily fix this by just moving your variable declarations to be inside the function where you want them.

Anyways, as I said, nice work and good luck learning C!

Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dash programs suneel112 Programming 12 26-01-2005 14:44
IFI's Serial Programs Doing Funny Stuff? Ian W. Programming 4 18-03-2004 21:43
Whats your honest opinion? Sean General Forum 50 17-04-2003 21:05
Dashboard programs and the char variable Ian W. Programming 13 26-06-2002 02:07
Dashboard programs archiver 2000 6 23-06-2002 23:10


All times are GMT -5. The time now is 05:24.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi