/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
  int len;
  char buffer[]="aaa<->bbb<->ccc<->";
  char result[10];
  char *p1,*p2;
  p1 = buffer;
  while((p2=strstr(p1,"<->"))!=NULL) {
     len = p2-p1;
     strncpy(result,p1,len);
     result[len]='\0';
     printf("%s\n",result);
     p1=p2+strlen("<->");
  }
  return 0;
}
