I have a functions which takes a char * as its only argument. I then perform some strtok operations on it. Sometimes it works and sometimes it doesent. It working depends upon how the string was constructed. For instance here are the two cases.
int main()
{
   char glob[] = "/abc/def/ghi";
   char *glob2 = "/abc/def/ghi";
   func(glob);  //this one works
   func(glob2); //this one doesnt work
   return 0;
}
What is the difference between the two allocation methods and why does strtok blow up on the second one?