Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void gen_random(char *s, const int len) {
- static const char alphanum[] =
- "0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz";
- for (int i = 0; i < len; ++i) {
- s[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
- }
- s[len] = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement