The XXX was declared deprecated prompt is forbidden in VC ++ express edition.

Source: Internet
Author: User

 

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.