You should initialize the char *a as following: char a[]="SAM"; I believe this will just solve your problem.
Separate names with a comma.