in this example, i would recommend strtok() instead of scanf.
Oh, and you don't need to allocate memory for a string already in memory.
The token gets set to 0.
#include <stdio.h>
#include <strings.h>
int main()
{
char A[50] = "name=john&last=doe&job=vacant&";
char *name, *last, *job;
name = strtok( A, "&" );
last = strtok( (char *)0, "&" );
job = strtok( (char *)0, "&" );
printf("name: %s\n", name );
printf("last: %s\n", last );
printf("job: %s\n", job );
return 0;
}