Advertisement
Guest User

Untitled

a guest
May 20th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.62 KB | None | 0 0
  1.  
  2.  
  3.    for(int assign = 0; assign < CODELEN; ++assign) // initialize array to NULL
  4.         {
  5.         m_codeTable[assign] = '0';
  6.         }
  7.  
  8.     char used[26] = { };
  9.     int index = 0;
  10.  
  11.     for(int counter = 0; counter < CODELEN; ++counter)
  12.         {
  13.         bool isCharUsed = false;
  14.         int counter2 = 0;
  15.         while(counter2 < CODELEN)
  16.                 {
  17.                 if(toupper(m_key[counter]) == toupper(used[counter2]))
  18.                         {
  19.                         isCharUsed = true;
  20.                         --index;
  21.                         }
  22.                 ++counter2;
  23.                 }
  24.         if(isCharUsed == false)
  25.                 {
  26.                 m_codeTable[index] = m_key[counter];
  27.                 used[index] = m_key[counter];
  28.                 }
  29.         else
  30.                 {
  31.                 }
  32.         cout << m_codeTable[index] << endl;
  33.         ++index;
  34.         }
  35.  
  36.     for(int counter3 = 0; counter3 < CODELEN; ++counter3)
  37.         {
  38.         int ascii = 90;
  39.                 if('0' == m_codeTable[counter3])
  40.                         {
  41.                         for(int index = 0; index < CODELEN; ++index)
  42.                                 {
  43.                                 if(ascii == used[index])
  44.                                         {
  45.                                         ascii = ascii - 1;
  46.                                         }
  47.                                 else
  48.                                         {
  49.                                         }
  50.                                 }
  51.                         m_codeTable[counter3] = ascii;
  52.                         }
  53.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement