Why does it cause a run-time error, character to int without initializing?
<p>First of all, I apologize about poor english.</p>

<p>At next simple program,</p>

<pre><code>void fx(int *a){
    for(int i=*a; i&lt;='Z'; i++)
    printf("%c", i);
}
int main(){
    int a;
    scanf("%c", &amp;a);
    fx(&amp;a);
    return 0;
}
</code></pre>

<p>I entered a capital letter at run-time, it caused FATAL error and was solved by killing proccess.</p>

<p>It does not cause any problem at next codes.</p>

<pre><code>//except fx()
int main(){
    int a;
    scanf("%c", &amp;a);
    return 0;
}
</code></pre>

<p>or</p>

<pre><code>//initialize int a
void fx(int *a){
    for(int i=*a; i&lt;='Z'; i++)
    printf("%c", i);
}
int main(){
    **int a = 0;**
    scanf("%c", &amp;a);
    fx(&amp;a);
    return 0;
}
</code></pre>

<p>I know it should be 'char' to input character. but I cannot understand about above situation.</p>

<p>What happened?</p>

<p>PS. I worked with VS2010, c++</p>
