Re: Any help?



"Vladimir S. Oka" <novine@xxxxxxxxxxxxxx> writes:
[...]
> In the context of OP's original question, which was:
>
> cj wrote:
> > Which would be true? The size of the array would be reduced to 10 or
> > the array size stays at 80 and the string fills array locations,
> > starting at array [0].
>
> I'd still say that array elements past the first 0, are "unused",
> i.e. the array stays the size 80 _and_ the string fills its locations
> starting with array[0].

If you use the array as a string (e.g., by passing the address of its
first element to printf() or strlen()), the array elements past the
first 0 will be unused. But since the language guarantees that all
those elements will be initialized to '\0', a program can legally use
them, and can depend on their initial values. (Not any program that
I'd wrote, though.)

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.



Relevant Pages

  • Re: Performance Question
    ... My original question was mainly asking whether it ... > dimensioned array. ... Using Redim Preserve to make any array larger is computationally ... Now, as to this string parsing problem, please state ... ...
    (microsoft.public.vb.general.discussion)
  • Re: Why is it so difficult to learn Ruby for me ?
    ... That is the answer I was going to give to the OP's original question. ... When I started to learn Ruby, it seemed to be all about syntax: ... a string, this is what you can do with it; this is an array; this is a ...
    (comp.lang.ruby)
  • Help in French|Spanish|German translation.
    ... I am also an author of User-defined string functions. ... WORDTRANEX (cSearched, cArExpressionSought | cExpressionSough, ... each string of the array is searched ... If the parameter nArStartOccurrence is -1 or omitted, the replacement starts ...
    (microsoft.public.fox.helpwanted)
  • Re: passing a string to a dll
    ... Joe, I really appreciate you taking the time to demonstrate this. ... sure how I would implement indexing it for random alphanumeric codes. ... I might handle the array. ... I actually have been wondering if I could use a second string ...
    (microsoft.public.vc.mfc)
  • Re: passing a string to a dll
    ... I might handle the array. ... I actually have been wondering if I could use a second string ... look at insertion cost, organization cost, and search cost. ...
    (microsoft.public.vc.mfc)