exception in strcpy();
void recid(string str,int *begin, int *end)
{
  char *f,*str2;
  const char c1[2]=":",c2[2]="-";
  strcpy(str2,str.c_str());
  f=strtok(str2,c1);
  f=strtok(NULL,c2);
  *begin=atoi(f);
  f=strtok(NULL,c2);
  *end=atoi(f);
}
could you help me to solve it?
 
     
     
    