当前位置:网站首页>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 .
边栏推荐
- 「开源摘星计划」Containerd拉取Harbor中的私有镜像,云原生进阶必备技能
- Convex optimization notes
- 【Golang】快速复习指南QuickReview(三)——map
- LeetCode 473. 火柴拼正方形
- Official announcement. Net 7 preview 5
- 官宣.NET 7 预览版5
- 准备好迁移上云了?请收下这份迁移步骤清单
- Game asset reuse: a new way to find required game assets faster
- GL Studio 5 installation and experience
- 好用的人事管理软件有哪些?人事管理系统软件排名!
猜你喜欢

I came from a major, so I didn't want to outsource

活动报名 | MongoDB 5.0 时序存储特性介绍

Programmable, protocol independent software switch (read the paper)

Open source SPL redefines OLAP server

JS高级程序设计第 4 版:生成器的学习

NAACL 2022 Findings | 字节提出MTG:多语言文本生成数据集

Can the biggest gamefi crash victim survive the bear market in May| May Monthly Report

Syntax of SQL union query (inline, left, right, and full)

Vprom notes

5 月最大的 GameFi 崩溃受害者能否在熊市中生存?| May Monthly Report
随机推荐
LeetCode 260. 只出现一次的数字 III
The "open source star picking program" container pulls private images from harbor, which is a necessary skill for cloud native advanced technology
Implementation of microblog system based on SSM
测试的重要性及目的
LeetCode 473. 火柴拼正方形
MySQL时间函数的运用,简单问题
Is it safe to pay new debts
Open source SPL redefines OLAP server
Timertasks notes
Naacl 2022 finds | byte proposes MTG: multilingual text generation data set
力扣每日一练之字符串Day6
Chaos engineering, learn about it
20省市公布元宇宙路线图
Is it safe to make new debt
LeetCode 1079. movable-type printing
Flagai Feizhi: AI basic model open source project, which supports one click call of OPT and other models
打新债 要求 打新债安全吗
Application of MySQL time function, simple problem
ZABBIX monitoring - Aruba AP operation data
解读2022年度敏捷教练行业现状报告