当前位置:网站首页>关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法
关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法
2022-06-26 00:13:00 【原来是这样^^】
方法一:也是最简单的,将scanf改为scanf_s就可以使用
虽然这样可以解决问题,但并不建议这样子做,原因是scanf_s不是c语言自己的,它只能在vs这个编译器里可以正常使用,在其它编译器里是不认scanf_s这个函数的,代码的移植性将大大削弱。
方法二:在第一行,注意,是第一行引入
#define _CRT_SECURE_NO_DEPRECATE即可
这样我们就可以用c语言自带的scanf啦。
这样其实也有一个弊端,就是我们每创建一个新项目就要重新添加这句话太麻烦了,我们可不可以以后一创建新项目它就自动在第一行就打出#define _CRT_SECURE_NO_DEPRECATE这句话呢,答案是可以的
1.下载一个名为《Everything》的软件,这是一款用于搜索文件名和文件位置的软件
2.然后打开《Everything》软件,搜索newc++file.cpp

鼠标右键打开路径

将它脱出桌面,右键编辑把上面那句#define _CRT_SECURE_NO_DEPRECATE写在文本第一行


3.将桌面的那个拖回到路径里面去,有的是复制回去,有的是直接放回去,效果一样

新建一个项目会发现他会自动打出#define _CRT_SECURE_NO_DEPRECATE

完成
边栏推荐
- Summary of xlnet model
- 27. template match
- Principle of voice wake-up
- GUN make (3) Makefile的规则
- JSON basic syntax
- GUN make (7) 执行make
- Summary of in-depth learning optimization techniques
- 2021-1-15 摸魚做的筆記Ctrl+c /v來的
- How to add a "security lock" to the mobile office of government and enterprises?
- regular expression
猜你喜欢

Android system startup security

Interpretation of script corresponding to postman assertion

Postman斷言對應脚本的解釋

如何为政企移动办公加上一道“安全锁”?

One stop solution EMQ for hundreds of millions of communication of Internet of things

Viwi interface

Shell regular expression

tos cos dscp 区别和作用

Postman接口测试之断言

阳光男孩陈颢天 受邀担任第六季完美童模全球总决赛代言人
随机推荐
biggan:large scale gan training for high fidelity natural image synthesis
Assertion of postman interface test
makefile 中export set ENV 的区别和作用
Principle of voice wake-up
Log4j2 vulnerability
Common deep learning optimizers
PTA class a simulated 8th bomb: 1164-1167
Accumulation of some knowledge points in machine learning
论文阅读 Exploring Temporal Information for Dynamic Network Embedding
Is it safe to log in the stock account on the flush? How to open a stock account in the flush
The 19th - 22nd week of scientific research training - about tnet and memnet
丨EGFR FISH 探针解决方案
Fasttext knowledge points summary
2021 - 1 - 15 notes de pêche Ctrl + C / V
Install tensorflow GPU miscellaneous
从在浏览器的输入框输入一个网址,到看到网页的内容,这个过程中发生了什么?
王老吉药业“关爱烈日下最可爱的人”公益活动在杭启动
Common basic Oracle commands
物联网亿万级通信一站式解决方案EMQ
2022 Anhui province safety officer C certificate examination practice questions simulated examination platform operation