I am using
VC ++ 2005
And
VC ++ 2008 express Edition
,
MS
Provides a set of secure string processing functions and
I/O
Function, for example
Scanf
The following
Warning:
Warning
C4996: 'scanf' was declared deprecated
It is easy to cancel this prompt. But I am very interested in its prompt. Let's take a look at it first.
Scanf
What was done during declaration, move the mouse
Scanf
Above, right-click and select"
Goto
Declaration"
, In
Stdio. h
File:
_ Crt_insecure_deprecate (scanf_s)
_ Cribd _ checkreturn_optInt
_ Cdecl
Scanf (_ in_z _ format_stringConst
Char
* _ Format,
...);
Such a statement. Previously added
_ Crt_insecure_deprecate (scanf_s)
Modify, jump to the definition of this macro:
# Define
_ Crt_insecure_deprecate (_ replacement)
_ Crt_deprecate_text ("This function or variable
May be unsafe. Consider using"
# _ Replacement"Instead. To disable deprecation, use
_ Crt_secure_no_deprecate. See online help for details ."
)
Check again
_ Crt_deprecate_text
Macro definition:
# Define
_ Crt_deprecate_text (_ text)_ Declspec
(Deprecated
(_ Text ))
These are very interesting. The header file of the compiler has many techniques to learn.
to cancel this message, by
MS
the prompt information is defined
_ crt_secure_no_deprecate
macro, because of my
project
is used to write a small
test
, so you must constantly change the source file, it is very troublesome to redefine this macro every time, in
VC
project
select
project
attributes, in
C/C ++
Preprocessor
define it in the predefined macro in
OK
now.