Sunday, July 1, 2012

Not Actually A Virus

This is not actually a virus, but there it's being detected as a virus. Reasons are quoted below..!

Code:
#include<stdio.h>
#include<conio.h>
union abc



{
    int a;
    int x;
    float g;
};
struct pqr
{
    int a;
    int x;
    float g;


} ;


void main()
{
    union abc b;
    struct pqr c;
clrscr();
b.a=10;
textbackground(2);
textcolor(6);
cprintf(" A = %d",b.a);
printf("\n Union = %d",sizeof(b));
printf("\n Structure = %d",sizeof(c));
getch();
}


Here, in Union abc and in Struct pqr, both the variable identifier and memory allocations are the same. This is acting like a function trying to copy another's action and is catched by AntiVir. Most of Antivirus Alert this as a virus..!

No comments:

Post a Comment