我想使用cout在c++中打印一条大消息。

例:

cout<<"Camera could not be opened in the requested access mode, because another
              application (possibly on another host) is using the camera."<<endl;

但我得到一个错误。

有什么帮助吗?

最佳答案

像这样:

 cout<<"Camera could not be opened in the requested access mode, because another "
          "application (possibly on another host) is using the camera."<<endl;

要么
 cout<<"Camera could not be opened in the requested access mode, because another\n"
          "application (possibly on another host) is using the camera."<<endl;

在C和C++中,编译器将并置两个彼此相邻的字符串。

07-24 09:45
查看更多