Timeline for why is printf not called when expected?
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 14, 2018 at 7:47 | vote | accept | Ajinkya | ||
Jul 22, 2017 at 10:03 | comment | added | Antti Haapala -- Слава Україні | The important part here is that you're using the IDE to run the program in a view in Eclipse, right? Then you need a screenshot. | |
Jul 21, 2017 at 18:45 | answer | added | apache | timeline score: 1 | |
Jul 21, 2017 at 15:29 | comment | added | EsmaeelE | It Ok for me. I cant reproduce your problem on GCC. | |
Jul 21, 2017 at 12:35 | comment | added | Jonathan Leffler |
Note that your question should be "Why isn't the output from printf() appearing when expected?" since you've not produced any evidence that the calls are not made but only that you don't see the output you expect.
|
|
Jul 21, 2017 at 11:53 | review | Close votes | |||
Jul 22, 2017 at 17:37 | |||||
Jul 21, 2017 at 11:46 | comment | added | BLUEPIXY |
try printf("Enter a number:\n");fflush(stdout);
|
|
Jul 21, 2017 at 11:44 | comment | added | Ajinkya | @BLUEPIXY I tried removing \n still printf is not called | |
Jul 21, 2017 at 11:43 | comment | added | user3185968 |
If the program does not recognize stdin/stdout as an "interactive device", it will be fully buffered. In this case, output may be buffered until a call to fflush(stdout) (or one of a number of other function calls) is encountered.
|
|
Jul 21, 2017 at 11:38 | history | edited | Ajinkya | CC BY-SA 3.0 |
deleted 2 characters in body
|
Jul 21, 2017 at 11:38 | comment | added | user3185968 | Pleast post a minimal reproducible example. Specifically, which environment you are using. Also, are you using a normal shell or are you reading/writing input/output from a file or pipe? | |
Jul 21, 2017 at 11:37 | history | edited | Ajinkya | CC BY-SA 3.0 |
added 233 characters in body
|
Jul 21, 2017 at 11:36 | comment | added | Scott Hunter |
Is the problem that scanf is not returning, or that the final call to printf is not producing output?
|
|
Jul 21, 2017 at 11:33 | history | asked | Ajinkya | CC BY-SA 3.0 |