2
I’m having problems using scanf_s in a char variable only in the visual studio. When it reaches the scanf_s line the program stops and brings me the following error:
Exception thrown at 0x7893E63C (ucrtbased.dll) in exercicio4.exe: 0xC0000005: Access Violation writing Location 0x00F00000.
This only happens in Visual studio, when using compilers online does not occur
#include <stdio.h>
#include <stdlib.h>
int main()
{
char a[25];
printf("Digite seu primeiro nome: ");
scanf_s("%s", a);
return 0;
}
Try to run as an administrator.
– Wictor Chaves