You're going to have to malloc the table. If it is unbounded in the
general case, and it is, you're going to need to use malloc and
[realloc] to expand it.
My goal is to stay [within] the
....C language
I was telling myself I was going to stay out of clc for a while but
alas here I am ...
I have a few questions for you
1) Why are you writing an application with unbounded input lengths?
he isn't he's writing a general purpose libray. (Almost) unbounded
strings,
arrays tables etc. are nice to write your application in terms of.
Your application may be bounded (are you sure though?) but a library
cannot be. I think its written into the GNU programming standards
that there should be no arbitary limits.
In 99% of all applications it's sufficient to set limits on inputs
making this moot. What sort of strings are you processing that you
absolutely can't set an upper limit on?
he does seem to making life difficult for himself. I'm guessing a text
editor
for NASA sized data sets.
2) Why is a two pass solution so bad?
because you do two passes... It is two passes of printf which is a
little
language all of its own. The malloc()s may drown the printf()s (but
they
may not- we need measurements or analysis).
3) w.r.t. having to use realloc/malloc/free/etc what do you think your
$FAVOURITE_LANGUAGE does [anyway]?
call malloc I expect. The point is *I* don't have to call malloc()
(or free() more to the point).
You don't think Java doesn't just
behind the scenes realloc the memory it allocated once you concatenate
more data?
I'm sure Jave behaves in a similar fashion to $FAVOURITE_LANGUAGE
How do you think computers work[?]
tiny tiny little elves carry bits around. Which are really small bits
of
electricity. Electricity is a sort of blueish fluff.
and why do you think this is limited to C?
Real Men punch their own cards and single step at the console.
It you can't understand self modifying code you don't belong at the
console.
4) Why are you against writing a library that does the realloc/etc
behind the scenes and then just write applications that call your
library? And why would that be a sign that C is bad?
5) Why do we care?
his thesis is that he has to write the library whilst in
OTHER_LANGUAGE
it would be written for him. This is the argument for all computer
languages. He just thinks C is a particularly poor language. After
he's said
that once everything else is just trolling.
Oh and Spinoza. and already read your calling-me-a-troll-is-equivalent-
to-anti-sematism.
It's crap.