Im trying to convert a double to a char* but so far the code I have tried (included below) just results in a segmentation fault. Any help or suggestions would be greatly appreciated!
int main(){
double ans = 3.41;
char* ansChar;
sprintf(ansChar,"%f",ans);
printf("%s",ansChar);
return 0;
}