Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(int assign = 0; assign < CODELEN; ++assign) // initialize array to NULL
- {
- m_codeTable[assign] = '0';
- }
- char used[26] = { };
- int index = 0;
- for(int counter = 0; counter < CODELEN; ++counter)
- {
- bool isCharUsed = false;
- int counter2 = 0;
- while(counter2 < CODELEN)
- {
- if(toupper(m_key[counter]) == toupper(used[counter2]))
- {
- isCharUsed = true;
- --index;
- }
- ++counter2;
- }
- if(isCharUsed == false)
- {
- m_codeTable[index] = m_key[counter];
- used[index] = m_key[counter];
- }
- else
- {
- }
- cout << m_codeTable[index] << endl;
- ++index;
- }
- for(int counter3 = 0; counter3 < CODELEN; ++counter3)
- {
- int ascii = 90;
- if('0' == m_codeTable[counter3])
- {
- for(int index = 0; index < CODELEN; ++index)
- {
- if(ascii == used[index])
- {
- ascii = ascii - 1;
- }
- else
- {
- }
- }
- m_codeTable[counter3] = ascii;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement