Filipe Nóbrega
Filipe Nóbrega

Reputation: 667

Scanf program access denied

I have this simple program that ask's your age.

#include <stdio.h>

int main(){

  int age;
  printf("How old are you?\n");

  scanf("%d", &age);
  return 0;
}

But when I try to run it on Windows it says Access Denied then my Norton anti-virus kicks in saying that a threat was solved, and that same threat has the name of my program.

If I compile and run any other programs that do not have scanf in it everything works as expected.

I have the MinGW compiler.

Upvotes: 1

Views: 576

Answers (1)

Abhijit Pritam Dutta
Abhijit Pritam Dutta

Reputation: 5591

Seems like your MinGW compiler's library has some hidden code which trys to access some vital information from your computer. Seems like malware is being introduced in your library. Un install your MinGW and install it from a trusted site.

Upvotes: 2

Related Questions