Special Counters
<p>I`m trying to create a special counter in C# ... I mean the counter will be consisting of characters not numbers.</p>

<p>I have a <code>char[]</code> of size 3:</p>

<pre><code>char[] str = new char[strSize];
int i = 0;
int tmpSize = strSize - 1;
int curr;
while(!isEqual(str,finalStr,strSize))
{
    str[strSize] = element[i % element.Length];
    i++;
    if (str[strSize] == element[element.Length - 1])
    {
        int j = strSize - 1;
        if (j &gt; 0)
        {
            j--;
            int tmpCntr = j+1;
            curr = getCurrentID(str[tmpCntr]);
            str[tmpCntr] = element[(curr + 1) % element.Length];
            while (str[tmpCntr] == element[0] &amp;&amp; (i % element.Length &gt; 0) &amp;&amp; tmpCntr &lt; 0)
            {
                tmpCntr--;
                curr = getCurrentID(str[tmpCntr]);
                str[tmpCntr] = element[(curr + 1) % element.Length];
            }
        }
    }
}
</code></pre>

<p>if the <code>strSize &lt; 3</code> the application works fine and gives accurate output. If the <code>strSize &gt;= 3</code>, the application goes in infinite loop!</p>

<p>Need help.</p>

<p>if this is hard this way, I would need a way to create a numerical counter and I`ll work on it to suite my application.</p>
