如果只想在一行代码中禁止显示警告,则可以使用suppress 警告说明符:#pragma warning(suppress: 4101)// here goes your single line of code where the warning occurs对于单行代码,其工作原理与编写以下代码相同:#pragma warning(push)#pragma warning(disable: 4101)// here goes your code where the warning occurs#pragma warning(pop)