当前位置:网站首页>Use of the vs2022scanf function. An error is reported when using scanf - the return value is ignored: Solutions
Use of the vs2022scanf function. An error is reported when using scanf - the return value is ignored: Solutions
2022-06-23 19:47:00 【51CTO】
scanf() yes C Language format input function , and printf Functions are also known in studo.h In the header file , Used here scanf function , Simple summation example , as follows 
In the seventh line of the current program , We used scanf Function , Then wait for the user's input , It accepts the address of the variable , So in general, in addition to pointer variables and array names, you must add &. Don't forget to &, Don't forget to &, Don't forget to &!!!
scanf Call format for (“”,);
After running, press the following mode to output num1,mum2 Value
It should have been a normal process
however
Report errors :“scanf” The return value is ignored
I searched the Internet , Successfully solved
You need to prefix the entire code with
define _CRT_SECURE_NO_WARNINGS
Running successfully , The following are successful examples 
Careful students will find that I use “scanf_s” function , instead of "scanf"
Because the return value is ignored scanf It is because... Is not used in the code scanf The return value of , Need to use scanf_s Instead of a function scanf,scanf yes C Language provides , and scanf_s Not the standard C Language provides , yes vs Compiler provided , Finally, the program finally runs .
边栏推荐
- Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181
- Stochastic process -- Markov chain
- Summary of accelerating mobile applications at network edge with software programmable FPGA
- 在线文本实体抽取能力,助力应用解析海量文本数据
- 金鱼哥RHCA回忆录:DO447管理用户和团队的访问--用团队有效地管理用户
- 35歲危機?內卷成程序員代名詞了…
- Real topic of the 13th National Competition of single chip microcomputer in the Blue Bridge Cup
- 基于SSM实现微博系统
- @@Script implementation of ishell automatic deployment
- 直播回顾 | 云原生混部系统 Koordinator 架构详解(附完整PPT)
猜你喜欢

为什么你的数据图谱分析图上只显示一个值?

每日刷题记录 (二)

好用的人事管理软件有哪些?人事管理系统软件排名!

5 月最大的 GameFi 崩溃受害者能否在熊市中生存?| May Monthly Report

Interview with Mo Tianlun | ivorysql wangzhibin - ivorysql, an Oracle compatible open source database based on PostgreSQL

20省市公布元宇宙路线图

增加双因素认证,不惧密码泄露,更不惧123456

How to write a great online user manual in 7 steps

FlagAI飞智:AI基础模型开源项目,支持一键调用OPT等模型

Summary of accelerating mobile applications at network edge with software programmable FPGA
随机推荐
打新债 要求 打新债安全吗
How to use data warehouse to create time series
Ugeek's theory 𞓜 application and design of observable hyperfusion storage system
Tcp/udp Fundamentals
JS高级程序设计第 4 版:生成器的学习
LeetCode 260. 只出现一次的数字 III
Syntax of SQL union query (inline, left, right, and full)
Gaussdb (DWS) database intelligent monitoring operation and maintenance service - node monitoring indicators
Are internal consultants and external consultants in SAP implementation projects difficult or successful?
Live broadcast review | detailed explanation of koordinator architecture of cloud native hybrid system (complete ppt attached)
Real topic of the 13th National Competition of single chip microcomputer in the Blue Bridge Cup
游戏资产复用:更快找到所需游戏资产的新方法
Vprom notes
如何使用物联网低代码平台进行流程管理?
LeetCode 每日一题——30. 串联所有单词的子串
Live sharing | Tencent cloud mongodb intelligent diagnosis and Performance Optimization Practice
打新债有条件吗 打新债安全吗
Goldfish rhca memoirs: do447 managing user and team access -- effectively managing users with teams
SAP实施项目上的内部顾问与外部顾问,相互为难还是相互成就?
String Day6 of Li Kou daily practice