Message-ID: <312945FA.7985@ns.sympatico.ca> From: Klaas MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Substrings References: <35db4401 DOT 5617263 AT news DOT algonet DOT se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 17 Organization: Sympatico Date: Thu, 20 Aug 1998 03:03:06 GMT NNTP-Posting-Host: 142.177.11.75 NNTP-Posting-Date: Thu, 20 Aug 1998 00:03:06 ADT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Nicklas Lindgren wrote: > > Are there any functions in libc for picking substrings out of strings? > > Nicklas Lindgren you could use this bit of code (or slight modification thereof): to put n characters of string source at position p into dest: void mid(char *dest, char *source, int p, int n) { char *c=source[p]; strncpy(dest,c,n); dest[n]=0; }