当前位置:网站首页>关于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

完成
边栏推荐
- 元气少女王钰洁 受邀担任第六季完美童模全球总决赛代言人
- Talking about interface test (2)
- Shell regular expression
- Oracle數據庫完全卸載步驟(暫無截圖)
- Some summary of model compression
- Wanglaoji pharmaceutical's public welfare activity of "caring for the most lovely people under the scorching sun" was launched in Hangzhou
- 二造实务案例答题技巧和举例汇总,满满都是精髓
- JQ获取对象的几种方式
- Postman断言对应脚本的解释
- Summary of knowledge points of catboost
猜你喜欢

Dataframe to list

Exploring temporary information for dynamic network embedding

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

Pixel6 unlock bootloader

Wanglaoji pharmaceutical's public welfare activity of "caring for the most lovely people under the scorching sun" was launched in Hangzhou

GNN (graph neural network) introduction vernacular

Can bus transceiver principle

Simple making of master seal

readv & writev

浅谈接口测试(二)
随机推荐
2021 - 1 - 15 notes de pêche Ctrl + C / V
Textcnn paper Interpretation -- revolutionary neural networks for sense classification
Abnova丨抗GBA单克隆抗体解决方案
正则表达式
Principle of voice wake-up
PTA class a simulated seventh bomb: 1160-1163
regular expression
Exploring temporary information for dynamic network embedding
Make a row of the dataframe a column name
Energetic girl wangyujie was invited to be the spokesperson for the global finals of the sixth season perfect children's model
recvmsg & sendmsg
PTA class a simulation bomb 10: 1119-1123
阳光男孩陈颢天 受邀担任第六季完美童模全球总决赛代言人
PTA class a simulated sixth bomb: 1156-1159
recv & send
PTA class a simulated ninth bullet: 1114-1117
Data analysis - similarities and differences between C-end and b-end data analysis
JQ 自定义属性取值
Oracle database complete uninstallation steps (no screenshot)
cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network