Combination Generator (via: re-definition of ... types)

J

James Dow Allen

Roman said:
I often come across in open-source software (device drivers or network
applications) declarations of standard types with new names, ...

These may be different "types" of typedefs than you had in mind,
but when it isn't fully clear which integer type is best, I like
new type-names so that the assumptions are very clear and
can be easily changed.

For example, my combination generator has
/* index to items: */
typedef unsigned short Dindex;

/* index to or number of combinations of items: */
typedef long Combnum;

(Usually anything would work, but "short" would be
inadequate in some applications, and "long" use
excessive memory for arrays in other applications.)

Perhaps I should start a new thread to "announce" it,
but readers are welcome to use (or better yet,
offer comments on) that combination generator:

http://freepages.genealogy.rootsweb.com/~jamesdow/Tech/gencombo.c
or
http://tinyurl.com/2452h/gencombo.c

James Dow Allen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,800
Messages
2,569,657
Members
45,406
Latest member
GraceRcl49
Top