I am compiling a C library on mac os x. When I typed in the input and after printing the data on the screen, I do not see anything.
char *path = NULL;
peerdisplay = "Bob";
printf("Insert the full 'To' path: ");
scanf(" %a[^\n]", &path);
printf("A path: %s \n", &path);
When I replace% a with% s, printing is fine, but after starting I have a segmentation error. I like working as a script.
source
share