Thread: Making unique integer ID# from a string.

  1. #16
    Registered User Sharke's Avatar
    Join Date
    Jun 2008
    Location
    NYC
    Posts
    303
    Do it in Python and use a dictionary. It'll probably take you around an hour to install Python, learn everything you need to know and write the script. I wrote a script to tally up and summarize exported Outlook data for my business in about 30 minutes using Python dictionaries - and I'm a total dumbass when it comes to programming.

  2. #17
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by MK27 View Post
    Adak, it will be exactly what I describe because you cannot just guess the first letter and subtract 42 or something. Using ASCII values you would need three digits for each letter, so the highest real value, if "zzz", would be array[122122122].
    @MK, I use int's to count Sudoku puzzle permutations that number in the thousands of trillions, in Turbo C. Your limits with int's are your own.

  3. #18
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    Quote Originally Posted by tabstop View Post
    Start at 0 (array indices start at 0). Every time you get a new name, add one.
    What's wrong with this one?

    Here you guys are arguing about hashing functions...

  4. #19
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    There's nothing wrong with a Master Control Number scheme, which was mentioned previously - nothing wrong with my substitution scheme, either.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. String Class
    By BKurosawa in forum C++ Programming
    Replies: 117
    Last Post: 08-09-2007, 01:02 AM
  2. String issues
    By The_professor in forum C++ Programming
    Replies: 7
    Last Post: 06-12-2007, 09:11 AM
  3. Custom String class gives problem with another prog.
    By I BLcK I in forum C++ Programming
    Replies: 1
    Last Post: 12-18-2006, 03:40 AM
  4. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  5. Another overloading "<<" problem
    By alphaoide in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2003, 10:32 AM