On 13 January 2016 at 10:57, Andrew Lowe <[email protected]> wrote:
> /*
>   * Activity Name:
>   * Programmer:
>   * Date:
>   * Comments:
>   */
> #include <stdio.h>
>
> int main(void)
> {
>         // Declare and initialise variables here
>         float                   inputValue = 0;
>
>         printf("Hello world\n");
>         printf("More from the app\n");
>         printf("Even more\n");
>         printf("Now lets try a scanf. Enter a float: \n");
>
>         scanf("%f", &inputValue);
>
>         return(0);
> }
>
> -----------------------------
>
>         I've compiled this using the latest, as of a week ago, versions of 
> both
> clang and gcc and the behaviour is the same.

This appears to be a buffering issue. When you write to stdout, the
data is buffered. You could try adding a fflush(stdout) just before
your scanf call. See
http://stackoverflow.com/questions/3723795/is-stdout-line-buffered-unbuffered-or-indeterminate-by-default
for a discussion.

Paul

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to