Home > Back-end > C not repeat big random number problem?
C not repeat big random number problem?
Time:09-17
C + + is there a better way to generate a random number, range between 0 ~ INT_MAX, Focus is not repeated, until each number is generated within the scope of this again so far?
CodePudding user response:
Generate a random number too simple needn't discuss The difficulty is to avoid repeat in order to avoid repeat you must save all data have been generated Range is too big without opportunistic space 32-bit application is very difficult to do this even if the scope of memory use bitmap stored data generated has Either on a 64 - bit program and then do Or save to other peripheral storage (file or database or network) The program to run visual will slow the
CodePudding user response:
The problem of your original post I feel the problem is you think half success
CodePudding user response:
Not to repeat generally will not require a wide range of random number Such as a database record serial number sequence number