C Program to find the number of unique characters

How to write a C Program to find the number of unique characters in C programming Language ?


This C Program to find the number of unique characters.

  1.         bool dup = false;
  2.  
  3.         //find the number of unique characters
  4.         for (i=0; i < iInLen; i++){
  5.                 dup = false;
  6.                 //Go  through every character in iBuf and check if that character is in chars
  7.                 for(int k = 0; k < unchar; k++){
  8.                         if(iBuf[i] == chars[k]){
  9.                                 dup = true;
  10.                         }
  11.                 }
  12.                 if(dup == false){
  13.                         chars[unchar] = iBuf[i];
  14.                         ++unchar;
  15.  
  16.                 }
  17.         }


Learn More :