What is the use of the #pragma warning in C #?

I just saw this code

#pragma warning disable 659, 660, 661

The MSDN article is not very helpful. What is the use of this line?

+5
source share
2 answers

From your link:

#pragma warning may be used to enable or disable certain warnings.

If you know that some code will trigger a warning, but you want to ignore it, you can use it. This will prevent the message from appearing.

+7
source

In C #, errors and warnings have numbers. #pragma warning disableallows you to suppress some warnings that the compiler may emit.

+7
source

All Articles