Use of unassigned local variable 'flag'
<p>Can't figure out why I'm getting an error on the <strong>flag</strong>. Any help will be appreciated!
goal is to generate a 40 character using the below specified characters.</p>

<p>public static string udidGen()
        {</p>

<pre><code>        bool flag;
        string s1 = "";
        string[] sArr2 = new string[] {
                                        "0", 
                                        "1", 
                                        "2", 
                                        "3", 
                                        "4", 
                                        "5", 
                                        "6", 
                                        "7", 
                                        "8", 
                                        "9", 
                                        "a", 
                                        "b", 
                                        "c", 
                                        "d", 
                                        "e", 
                                        "f" };
        string[] sArr1 = sArr2;
        Random random = new Random();
        int i = 0;

        while (**flag**)
        {
            s1 += sArr1[random.Next(0, 15)];
            i++;
            flag = i &lt; 40;
        }
        return s1;
    }
</code></pre>
