C++/c

Advertisement


Question
sir pragmas in c language can be used to supress warnings of a programme.can you give a programme in c with pragmas to supress warnings?this programme should be executable in turbo c.

Answer
Hello Phaneendra

Pragmas are a way to give more information to the compiler to make it behave a certain way. Different compilers have different pragmas. You can read more about pragmas for the gcc compiler here
http://gcc.gnu.org/onlinedocs/cpp/Pragmas.html

and for the Microsoft compiler here
http://msdn.microsoft.com/en-us/library/d9x1s805%28v=vs.71%29.aspx

and to disable warnings in Microsoft compilers, you can look at the examples here
http://msdn.microsoft.com/en-us/library/2c8f766e%28v=vs.71%29.aspx

It is quite rare to use prgamas in programming. I rarely see them used, so if you are a beginner, you should probably spend time learning other things.

One more point I'd like to make. Warnings are often very useful and your code will be better if you fix the warnings instead of trying to hide them.

Best regards
Zlatko

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Zlatko

Expertise

No longer taking questions.

Experience

No longer taking questions.

Education/Credentials
No longer taking questions.

©2016 About.com. All rights reserved.