I'm a bit rusty in C, but I've come across this strange problem:
I wrote this program:
#include <stdio.h>
main()
{
int n;
n=1;
while (n>0)
{
puts("Write a number: ");
scanf(" %d",&n);
printf("This is the number you wrote: %d\n", n);
}
}
Apparently there are absolutely no syntax errors, and for what I could understand, neither was any compiling error. It compiled and built perfectly. Now, if I switch this line:
puts("Write a number: ");
with this one:
printf("Write a number: ");
it compiles with no errors but when the compiled object launches, it immediately stops and an anti-virus warning pops up saying it identified a trojan horse. Before taking any conclusions, I built it several times and after getting the same message I scanned it in virustotal.com and this was the result.
Well I know puts is actually more correct than printf given the objective, but still it should work just fine...
What's wrong here?
I'm using AVG anti-virus, and Pelles C to compile.
Thanks in advance.