Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!ai-lab!sah@gnu.ai.mit.edu From: sah@gnu.ai.mit.edu (Tarador) Newsgroups: comp.lang.c Subject: EXPLODE ROUTINE Message-ID: <15431@life.ai.mit.edu> Date: 30 Apr 91 14:49:48 GMT Sender: news@ai.mit.edu Organization: Circle-Z Lines: 43 The following program is akin to the MUF primitive EXPLODE, if any of you are familiar with MUCK. Anyway, it works like this: x = explode(char *data, char *trigger, char **array); Where x is an int, *data is a a data string, *trigger is the string to explode on, and **array is filled by results. So, x = explode("Hello.Test", ".", results); That SHOULD put "Hello" in results[0] and "Test" in results[1]. But, for some reason, I keep getting a bus error. Program follows: int explode(); main() { int c,cc; char **arr, x[50], trig[5]; gets(x); gets(trig); cc = explode(x, trig, arr); for (c=0;c