Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!think.com!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!mailer.cc.fsu.edu!prism!gt4512c From: gt4512c@prism.gatech.EDU (BRADBERRY,JOHN L) Newsgroups: comp.lang.c Subject: Re: Finding Available Length Of Strings... Message-ID: <16985@hydra.gatech.EDU> Date: 13 Nov 90 16:47:05 GMT References: <16752@hydra.gatech.EDU> <16758@hydra.gatech.EDU> <1990Nov09.183957.15122@dirtydog.ima.isc.com> <1990Nov13.140527.14797@ssd.kodak.com> Organization: Georgia Institute of Technology Lines: 44 In article < 34449 weimer@ssd.kodak.com> (Gary Weimer) writes: >>>In article <16758@hydra.gatech.EDU> gt4512c@prism.gatech.EDU >>>(BRADBERRY,JOHN L) writes: . . . >>>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. >> >>(e) Use the "standard" C workaround for this problem. > >As other people have pointed out, this question looks like it was >posed by a C crossover from another language, so why don't we >tell them what C can do, instead of what it can't. > Actually, in the graphics and signal processing area, I frequently have to port (rewrite) thousands of lines of code from other languages to C. In the process, I find it quite interesting to attempt where practical (possible) to duplicate some features so that the code algorithms appear as similar as possible. C makes this possible more often than not. The original post was in no way a criticism of C (I think the language is tremendous!), but a question of how something might be done! To date I've gotten close to 100 very creative 'workarounds' which is the next best thing to an exact solution. For that I am very thankful because I'm sure few of us would like to 'intentionally' recreate the wheel... -- John L. Bradberry |Georgia Tech Research Inst|uucp:..!prism!gt4512c Scientific Concepts Inc. |Microwaves and Antenna Lab|Int : gt4512c@prism 2359 Windy Hill Rd. 201-J|404 528-5325 (GTRI) |GTRI:jbrad@msd.gatech. Marietta, Ga. 30067 |404 438-4181 (SCI) |'...is this thing on..?'