I did make a very simple program to test the & parameter. But when I try to run the program, my Antivirus screams out loud!
The program I made:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
usingnamespace std;
void Test (int & TestTal)
{
TestTal = 10;
cout << "TestTal is: " << TestTal << endl;
}
int main ()
{
int Tal = 5;
cout << "Tal is: " << Tal << endl;
Test ( Tal );
cout << "Tal is: " << Tal << endl;
}
I made the program to test if the value of Tal will change after it has been sent to my function Test.
It runs through the compilor with no problems, but when I press RUN, my antivirus stops the process and tells me:
Attack Gen:Variant.Graftor.7493
And it gets removed.
I looked it up, and the description is:
A Generic Detection for programs with features or behaviors indicative of known malicious threats, such as trojans, worms or viruses.
The heuristics of most antivirus software are horribly broken, it's very hard to write a program that isn't detected as malware by at least a few scanners.
Are you testing the debug build? If so, does the release build work?
top toolbar, there is drop down box with the word 'Debug' click it and set it to 'Release' and compile again.
You may also want to look into getting a different anti virus, although I've had problems like this with most of them, a bad one is more likely to detect a false-positive.
If you want to make it run in what is the equivalent of Release mode, just go to Settings->Compiler, Compiler Settings->Compiler Flags, tick 'Strip all symbols from binary' and 'Optimize even more (for speed)' and untick 'Produce Debugging Symbols'