Mail Archives: djgpp/1998/05/01/08:46:22
From: | brunobg AT geocities DOT com (Bruno Barberi Gnecco)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Help on array of pointers
|
Date: | Fri, 01 May 1998 12:41:12 GMT
|
Organization: | UNINET (Unisys Brasil Internet Access Service)
|
Lines: | 29
|
Message-ID: | <3549c0bb.1910797@news.unisys.com.br>
|
NNTP-Posting-Host: | saopm03p02.unisys.com.br
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I'm writing a program that creates combinations. It (should) work this way:
there's a string containing possible characters, and I need all the possible
combinations of X characters. What I need is an array of X pointers, so I could do
this way:
/ = pointer[0] \ =pointer[1]
at beggining:
/
\
A B C D E
then and output would be created in the form: *pointer[1], *pointer[0]. Next
combination: I move pointer[0] one character, this way:
/
\
A B C D E
this would output now 'ab', and so on. When pointer[0] reaches the end and is
updated, it should point again to the beggining, and pointer[1] should move one
character:
/
\
A B C D E
and so on... My questions are: how do I create this array of pointers? what's the
best method to do this 'end' movement?
"There's never enough time to do all the nothing you want" Bill Watterson
"Is ALL that we see or seem / But a dream within a dream?" - Edgar A. Poe
Bruno Barberi Gnecco <brunobg AT geocities DOT com> ICQ #1383173 - PGP 5.0i user
-=My other OS is Linux=- 3DS4, Max, Rhino, Photoshop and everything about
computer graphics? It sure is on Graphx Page!!! http://graphx.home.ml.org
- Raw text -