Problems with input and output in the C language in Visual Studio

Asked

Viewed 47 times

1

Below I have a code simple in C, the problem is that if I leave as is it does not print the received name on the screen, but when I change the scanf_s for scanf it works normally. What would be the reason ?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
char nome[20];
int  ru;

printf("Nome: ");
scanf_s("%s", nome);
printf("\n\n");
printf("%s", nome);

}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.