鉴于以下情况:
const char opn[8] = { 0x16, 'O', 'P', 'N', 0x17, 0xa8, 0xa9, '\0' }; std::cout << opn; sleep(5);
cout该字符串仅在五秒后才会被写入。预期的行为是将消息打印到cout,然后等待几秒钟。
cout
为什么会出现这种情况?
c++ concurrency sleep iostream
c++ ×1
concurrency ×1
iostream ×1
sleep ×1