Finding Available Length Of Strings...

BRADBERRY,JOHN L gt4512c at prism.gatech.EDU
Wed Nov 14 03:47:05 AEST 1990


In article < 34449 weimer at ssd.kodak.com> (Gary Weimer) writes:

>>>In article <16758 at hydra.gatech.EDU> gt4512c at 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 at prism
2359 Windy Hill Rd. 201-J|404 528-5325 (GTRI)       |GTRI:jbrad at msd.gatech.
Marietta, Ga. 30067      |404 438-4181 (SCI)        |'...is this thing on..?'   



More information about the Comp.lang.c mailing list