参考:https://blog.csdn.net/liu16659/article/details/86546239
[Error] cannot pass objects of non-trivially-copyable type ‘std::string {aka class std::basic_string}’ through ‘…’
1. 报错
[Error] cannot pass objects of non-trivially-copyable type ‘std::string {aka class std::basic_string}’ through ‘…’
2. 原因
不应该使用printf输出一个String类型的字符串
3.解决办法
使用cout << str
4.注
同样的问题有:
使用scanf【c语言】输入string【c++】的对象。这个也会引起程序的崩溃