Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi guys, I'm looking to write a program, something i do quite often, but this time i'm going for something special, something quite grand, s to speak, on a larger scale than i would normally do.
In this program I hae several categories of functions to be performed (Programming in C)
For example:
eat, sleep, drink
and in each category i need to have several, infact dozens of functions:
eat->banana
eat->pizza
eat->chocolate
------
sleep->on the floor
sleep->in a bed
sleep->for 7 hoursetc, etc
These are of course just an analogy.
The point is, I'm not quite sure how i should sort these sub categories out programtically, of course i could sort them in the menu in to categories and each menu category would open a sub menu with each of the sub item in (pizza, banana, chocolate.)
Would I need, (optimally) to sort each group of functions into a seperate include file, or somehow group them in another way, or would it be fine to simply write them all out as a list of functions in a seperate include?
I think this kind of thing comes out of experience rather than knowledge, in the past i have had experience only with single functions calling other functions etc but not whole categories of functions. Saying that, it's possible that my functions need not be functions in their own right, but they could be cases in the whole switch thing.
Any input would be appreciated, thanks.
AMD X2 4600+ AM2 ACFrzr64
M2N32-Sli Dlx
2x 1GB Corsair XMS2 DDR2 800
NvGeforce7600GT
Enrmx. Lib. 500W
2x 250GB SATA2 7200 RAID 0
1x 200GB SATA2 7200
Logitech G7 Carbon SE

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |