为什么这段代码输出文字"\n"而不是换行?

con*_*ong 0 c++

以下代码的输出是什么?

std::cout<<"what is the output \\n hello \'world\' world";
Run Code Online (Sandbox Code Playgroud)

我认为输出应该是:

what is the output
hello 'world' world
Run Code Online (Sandbox Code Playgroud)

但实际产量是 the output \n hello 'world' world

为什么\n输出不是新线?

Ben*_*son 10

你的双反斜杠\\是一种逃避,\你会看到它\n.如果需要换行符,请使用单个反斜杠\n.