Altera_Forum
Honored Contributor
15 years agohello world - strange variables behavior
Hello,
I'm new to nios2 developpement and i'm having problems running the simple hello_world exemple : When I lauch this code :int main()
{
unsigned char i,j,k;
printf("Hello from Nios II!\n");
while(1){
i++;
j++;
k++;
if(k==100){
printf("a");
}
}
return 0;
}in the debugger, i can see that the 'i' variable is incrementing correctly, but the 'j' variable always have the value 203 and the 'k'variable always have the value 0. Although i cant see the 'k' value changing, the program does go in the if statement. Could anyone explain to me why i cant monitor correctly the variables values? Thanks ps: running this program, i also have an other problem regarding the console ouput as described in this post : alteraforum.com/forum/showthread.php?t=27499. I supposed it could be related