I have the following code
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *A, B, C, D;
printf("Enter name A:");
scanf("%s", &A);
printf("Enter name B:");
scanf("%s", &B);
printf("Enter name C:");
scanf("%s", &C);
printf("Enter name D:");
scanf("%s", &D);
printf("%s, %s, %s, %s \n", A, B, C, D);
return 1;
}
it accepts four strings but crashes before printing them out?
the second thing I would like to do, is pass those strings(A,B,C,D) to a function that accepts void pointers, would I have to cast them to a void pointer first??