When using sprintf, the compiler warns me that the function is deprecated.
How can I show my own compiler warning?
In Visual Studio,
#pragma message ("Warning goes here")
On a side note, if you want to suppress such warnings, find the compiler warning ID (for the deprecated warning, it's C4996) and insert this line:
C4996
#pragma warning( disable : 4996)
#pragma warning( disable : 4996