Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!spdcc!ima!dirtydog!karl From: karl@ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Finding Available Length Of Strings... Message-ID: <1990Nov09.183957.15122@dirtydog.ima.isc.com> Date: 9 Nov 90 18:39:57 GMT References: <16752@hydra.gatech.EDU> <16758@hydra.gatech.EDU> Sender: news@dirtydog.ima.isc.com (NEWS ADMIN) Reply-To: karl@ima.isc.com (Karl Heuer) Organization: Interactive Systems Lines: 15 In article <16758@hydra.gatech.EDU> gt4512c@prism.gatech.EDU (BRADBERRY,JOHN L) writes: >Just a note of clarification here...I am talking about a character array >and I am looking for a solution (not the obvious '...add another length >parameter')...I would like the function to be able to 'figure it out!' Here are the options that spring to mind: (a) Pass a length parameter. (b) Pass a pointer to the end of the string. (c) Implement a string structure that does one of the above for you, e.g. typedef struct { char *start; char *current; char *end; } string_t; (d) Use only implementations that support the "Read Operator's Mind" syscall. Next question? Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint