Hello That fflush is for fgets
Yes, with a stdout flush, message prints but the question remains about why is it needed and how can I get input echo Thanks Grr El lun, 25 ene 2021 a las 13:30, Ken Pettit (<petti...@gmail.com>) escribió: > Hey Grr, > > You need the fflush(stdout) call to be *after* the printf("\nEnter > Command:"). > > If the printf doesn't end with \n, then the stdout won't be flushed. > > Ken > > On 1/25/21 11:25 AM, Grr wrote: > > Hello to all > > > > Is there a way to get stdout without a LF? > > > > I have something like > > > > case INPUT_CMD: > > fflush(stdin); > > printf("\nEnter Command:"); > > fgets(input, INPUT_STRING, stdin); > > spitest.cmd = input[0]; /* First char is the command > */ > > > > that in Linux prints message and waits for input but in Nuttx shows > nothing. > > > > I don't want LF because that destroys the format I want for program > > interface > > > > Another related issue is I don't get echo from input > > > > How do I get messages printed without a LF and echo from input? > > > > TIA > > > > Grr > > > >