I am learning C in university now. I want to get the input from the user and then print it on screen. I tried scanf and fgets and both of them crash. Please help i need to learn how to get the input and then print it.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char name[256];
printf("Write something:\n");
gets(name);
printf("You wrote: %s", name) ;
return 0;
}