Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1.  
  2. template <class T>
  3. string Deposito<T>::geraChave(){
  4.     char caracteresParaChave[] = "0123456789!@#$%^&*ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  5.  
  6.     int tam_Chave;
  7.     srand(time(NULL));
  8.     tam_Chave = rand() % 40 + 10;
  9.  
  10.     string myChave;
  11.  
  12.     for (int i = 0; i < tam_Chave; i++)
  13.     {
  14.         int caracter = rand() % QTD_CHARS_PARA_CHAVE + 1;
  15.         myChave = myChave + caracteresParaChave[caracter];
  16.     }
  17.     return myChave;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement