Do you know how to fix those errors ?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Do you know how to fix those errors ?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00 %
52
33
34
}
35 Evoid runMenuFinal ExamDao Dang() {
36
int option;
37
int usrInput;
38
do {
39
40
41
42
品 43 4 45 46 7 48 49501234556 57 58
44
47
Error List
Entire Solution
Code
A C6031
A C6031
XC4996
Acquis
QUIICU SUMASAM Dace
"\nActual Submission Date :
XC4996
Error List Output
10
printf("**************
"\n*
MENU - Final Exam
*\n"
"\n* (1) Calling displayOddDigitInfoDaoDang() *\n"
"\n* (2) Quit
*\n"
"\n*********
******************************\n");
printf("\n\nEnter an integer for option + ENTER: ");
scanf("%d" &option);
switch (
case 1:
prin
case 2:
0 A 2
break;
*
scan C6031: Return value ignored: 'scanf'.
prin
displayOddDigitInfoDaoDang (usrInput);
Search Online
default:
(const char [3])"%d"
printf("\n\nQuit!");
break;
个 ↓
ZULL I UJ 1 22
2022 / 09 / 12");
Description
Return value ignored: 'scanf'.
Return value ignored: 'scanf'.
**************"
X 2 Errors A 2 Warnings ● 0 Messages
JigitInfoDaoDang() with argument of %d", usrInput);
Build + IntelliSense
'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use
_CRT_SECURE_NO_WARNINGS. See online help for details.
'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use
CRT SECURE NO WARNINGS. Cac online help for detaile
Project
Homework 1
Homework 1
Homework 1
Homework 1
Ln: 103
File
Search Error List
Source.cpp
Source.cpp
Source.cpp
Ch: 2
Source.cpp
TABS
▼
45
CRLF
Line
45
49
49
T
4 x
P
Transcribed Image Text:00 % 52 33 34 } 35 Evoid runMenuFinal ExamDao Dang() { 36 int option; 37 int usrInput; 38 do { 39 40 41 42 品 43 4 45 46 7 48 49501234556 57 58 44 47 Error List Entire Solution Code A C6031 A C6031 XC4996 Acquis QUIICU SUMASAM Dace "\nActual Submission Date : XC4996 Error List Output 10 printf("************** "\n* MENU - Final Exam *\n" "\n* (1) Calling displayOddDigitInfoDaoDang() *\n" "\n* (2) Quit *\n" "\n********* ******************************\n"); printf("\n\nEnter an integer for option + ENTER: "); scanf("%d" &option); switch ( case 1: prin case 2: 0 A 2 break; * scan C6031: Return value ignored: 'scanf'. prin displayOddDigitInfoDaoDang (usrInput); Search Online default: (const char [3])"%d" printf("\n\nQuit!"); break; 个 ↓ ZULL I UJ 1 22 2022 / 09 / 12"); Description Return value ignored: 'scanf'. Return value ignored: 'scanf'. **************" X 2 Errors A 2 Warnings ● 0 Messages JigitInfoDaoDang() with argument of %d", usrInput); Build + IntelliSense 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use CRT SECURE NO WARNINGS. Cac online help for detaile Project Homework 1 Homework 1 Homework 1 Homework 1 Ln: 103 File Search Error List Source.cpp Source.cpp Source.cpp Ch: 2 Source.cpp TABS ▼ 45 CRLF Line 45 49 49 T 4 x P
++Homework 1
52
33
34
35
100 %
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
}
Evoid runMenuFinal Exam Dao Dang() {
F
REQUIICO SUPERsion Date
"\nActual Submission Date :
Build failed
int option;
int usrInput;
do {
Error List Output
printf("*********
"\n*
MENU - Final Exam
*\n"
"\n* (1) Calling displayOddDigitInfoDaoDang() *\n"
"\n* (2) Quit
*\n"
"\n******
printf("\n\nEnter an integer: ");
scanf("%d" &usrInput);
printf("\n\nEnter an integer for option + ENTER: ");
scanf("%d" &option);
switch (option) {
case 1:
break;
(Global Scope)
ZUZZ I UJ 1 12
2022 / 09 / 12");
case 2:
printf("\n\nCalling displayOddDigitInfoDaoDang
displayOddDigitInfoDao Dang (usrInput);
printf("\n\nQuit!");
break;
default:
X0 A 2 ↑ ↓
Output
Show output from: Build
1>------ Build started: Project: Homework 1, Configuration: Debug x64 ------
1>Source.cpp
1>C:\Users\louis\source\repos\CIS27Fal12022DaoDangHw1.c\Homework
******"
*****\n");
£=== ab
Microsoft Visual Studio
x
displayOddDigitInfoDao Dang(int arg)
Unable to start program
'C:\Users\louis\source\repos\CIS27 Fall2022Dao DangHw1.c\x64\Debu
g\Homework 1.exe'.
The system cannot find the file specified.
OK
X
Ln: 103 Ch: 2
TABS
1\Source.cpp(45,3): error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s ins
1>C:\Users\louis\source\repos\CIS27 Fal12022DaoDangHw1.c\Homework 1\Source.cpp (49,4): error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s ins
1>Done building project "Homework 1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, up-to-date, 0 skipped ==========
+
CRLF
Д Х
Transcribed Image Text:++Homework 1 52 33 34 35 100 % 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 } Evoid runMenuFinal Exam Dao Dang() { F REQUIICO SUPERsion Date "\nActual Submission Date : Build failed int option; int usrInput; do { Error List Output printf("********* "\n* MENU - Final Exam *\n" "\n* (1) Calling displayOddDigitInfoDaoDang() *\n" "\n* (2) Quit *\n" "\n****** printf("\n\nEnter an integer: "); scanf("%d" &usrInput); printf("\n\nEnter an integer for option + ENTER: "); scanf("%d" &option); switch (option) { case 1: break; (Global Scope) ZUZZ I UJ 1 12 2022 / 09 / 12"); case 2: printf("\n\nCalling displayOddDigitInfoDaoDang displayOddDigitInfoDao Dang (usrInput); printf("\n\nQuit!"); break; default: X0 A 2 ↑ ↓ Output Show output from: Build 1>------ Build started: Project: Homework 1, Configuration: Debug x64 ------ 1>Source.cpp 1>C:\Users\louis\source\repos\CIS27Fal12022DaoDangHw1.c\Homework ******" *****\n"); £=== ab Microsoft Visual Studio x displayOddDigitInfoDao Dang(int arg) Unable to start program 'C:\Users\louis\source\repos\CIS27 Fall2022Dao DangHw1.c\x64\Debu g\Homework 1.exe'. The system cannot find the file specified. OK X Ln: 103 Ch: 2 TABS 1\Source.cpp(45,3): error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s ins 1>C:\Users\louis\source\repos\CIS27 Fal12022DaoDangHw1.c\Homework 1\Source.cpp (49,4): error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s ins 1>Done building project "Homework 1.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, up-to-date, 0 skipped ========== + CRLF Д Х
Expert Solution
Step 1

The error we are getting is 'scanf is unsafe'. It is unsafe because scanf leads to possible buffer overflow.

So, we need to replace unsafer version of scanf with safer version i.e scanf_s.

 

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education