#include <stdio.h>
#include <stdlib.h>
/*(*void)displayValue(char* );*/
void main()
{
char* userInput = (char*)malloc(sizeof(userInput);
printf("\n\nEnter : ");
scanf("%s", &userInput);
printf("\n\nEntered : %s\n\n",userInput);
}
I have got core dump by running this code. Please suggest.