Android IDE (AIDE) Support Forum

Potential BUG in compiling C language

Hello,

While I am very happy with the java side and android side I been trying out C language on AIDE and with this simple example you can see that the order of execution does not seem to be correct.

Current code is running in wrong order…

#include <stdio.h>

int main()
{
char name[25];
printf(“Enter any word: “);
scanf(”%s”, name);
printf(" Word: %s ",name);
}

The scanf is executing before printf…

Result:

1 Test
2 Enter any word:
3 Word: Test

Please advise why this happening and what can be done to fix it.

Many Thanks