I compile a C library on mac os x. When I typed the input and after printing on the screen the data I don’t see something.
char *path = NULL;
peerdisplay = "Bob";
printf("Insert the full 'To' path: ");
scanf(" %a[^\n]", &path);
printf("A path: %s \n", &path);
When I replace the %a to %s, the printing ok, but after the running I have a segmentation error.
I like to running such as script.
%a is gnu-specific non-standard extension to scanf grabs. What says your OS X manpages about it ?
^is that your intent ?
in that case, be aware that