关于codeblock遇到的bug并引起电脑杀毒软件木马提醒

偶尔用codeblock编一个小程序,很简单,如下:

#include <stdio.h>
#include <stdlib.h>
#include <string >
#include <iostream>
using namespace std;

int main()
{
    string clear_text;
    int cycle=0;
    cout<< "please input the clear_text:";
    getline(cin,clear_text);
    cout << "please input the periodicity:" ;
    cin >> cycle;
    cout << cycle;
    return 0;
}

运行没有结果:


不仅如此,每次敲这段代码,电脑杀毒软件都会提示我这段程序是木马


尝试删除重新建c++文件,也会提示木马。

于是,开始测试是哪句话出了问题,经过多次测试发现,在main函数中,除了必要的两条声明变量语句,其余四条语句:

 cout<< "please input the clear_text:";
    getline(cin,clear_text);
    cout << "please input the periodicity:" ;
    cin >> cycle;
    cout << cycle;

删去任意一条,程序都可以正常运行;

除此之外,我还把两条声明语句,放在main函数外,程序仍然可以正常运行。

对木马的组成并不了解,所以不知道是什么造成被杀毒软件不识别。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值