Re: [Dev-C++] Producing a endless list of strings.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-07-31 16:19:39
|
Cool, thanks for your help
Signed
David Mcken
--- manilius <man...@gm...> wrote:
>
> Hi
>
> > Ok, the idea was to create all the possible
> combinations
> > (up to 100
> > characters long) using all the avalible characters in
> the
> > ascii character
> > set from 32 (space) to 126 (~) inclusive. When we try
> to
> > increment '~' we
> > end up getting a space and we increment the next
> character
> > in the string and
> > applying the same overflow rule.
>
> Okay, that would be one way to do it, but it does involve
> a lot of string
> manipulation (check a character and change it) which is
> not needed with
> recursion. Is there a special reason you want to use your
> "overflow
> algorithm"?
>
> If you want more characters with the recursion example I
> sent you, just add
> them to the character table:
>
> for( int i=0; i<92; i++) CharacterTable.push_back(' '+i);
>
> should include all characters you want.
> If you need zero-terminated strings, you can use the
> function c_str() of the
> std::string class to create them.
>
>
> But again: There is no way to create a list of all
> possible strings with the
> length of 100. You have
>
> (# of possible charcters)^length of the string
>
> possibilities. This results in a huge number (try
> calculate 92^100 :)
>
> ciao...
> ...manilius
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET
> sites including
> Data Reports, E-commerce, Portals, and Forums are
> available now.
> Download today and enter to win an XBOX or Visual Studio
> .NET.
>
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE:
> http://www23.brinkster.com/noicys/devcpp/ub.htm
>
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
=====
Signed
David Mcken
Life Sucks
Live with it
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
|