gpt4 book ai didi

c++ - 嵌套开关给出错误并指示病毒(特洛伊木马)

转载 作者:行者123 更新时间:2023-11-30 02:34:35 25 4
gpt4 key购买 nike

尝试使用开关盒(嵌套开关)制作程序时,我的系统提醒我我的程序有病毒(木马)。这怎么可能?我是编程新手(完全新手),所以我将不胜感激任何帮助。

任务 - 根据需求制作自动电话回复系统(这正是我想尝试的)。

#include<iostream>
using namespace std;
void customer_service()
{
cout<<"Kindly wait for our employees to contact you";
}
void feedback()
{
cout<<"Kindly record your feedback after the beep";
}
void offer()
{
cout<<"You are entitled to accept our one-time offer. You will be directed to one of our employees shortly\n";
}
void satisfied()
{
cout<<"Thanks a lot for calling. Have a great day ahead";
}
int main()
{
int input,yes_no;
cout<<"\nPress 1 if you would want to directly contact our employee\n";
cout<<"\nPress 2 if you wan to give a feedback\n";
cout<<"\nPress 3 if ypu would want to know about our offers\n";
cout<<"\nPress 4 if you are satisfied with our service\n";
cout<<"\nKindly press the required key\n";
cin>>input;
switch (input)
{
case 1:
customer_service();
break;
case 2:
feedback();
break;
case 3:
offer();
cout<<"Would you like to accept our one time offer? You will get a 50% decrease in tariff";
cin>>yes_no;
switch (yes_no)
{
case 1:
cout<<"Congratulations! You have won our one time offer";
break;
default:
cout<<"Guess you didn't like our offer";
break;
}
break;
case 4:
satisfied();
break;
default:
cout<<"Kindly press either one of '1, 2, 3 or 4' keys. Thankyou.";
}
cin.get();
return 0.00;
}

This is the indication of Trojan and the program not executing

最佳答案

这是误报。

您可以通过初始化变量来帮助解决这个问题。实际上,您没有检查读入 yes_no 是否成功,因此您的程序具有未定义的行为。这可能会让您的 AV 认为您正在尝试编写内存漏洞。

否则,获得更好的 AV!

关于c++ - 嵌套开关给出错误并指示病毒(特洛伊木马),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34454003/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com