at a guess, it's not flushing stdout because Item3 isn't followed by a '\n'. Try adding one and see whether that helps.

(I'm also guessing that you're showing just an excerpt of the actual code that's proving troublesome .. )

regards ..

On Tue, 2019-01-29 at 09:26 -0500, Ilyas Hamadouche wrote:
The following code always outputs:
Item1
Item2


Code:
#include <iostream>
#include <string>

int main() {
  std::string string_test{"Item1\nItem2\nItem3"};
  std::cout << string_test;

  return 0;
}

 Any explanations? Is this a bug?



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post119454
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com