POV-Ray : Newsgroups : povray.programming : Bug in Compute_Axis_Rotation_Transform() : Re: Bug in Compute_Axis_Rotation_Transform() Server Time
28 Jul 2024 14:33:40 EDT (-0400)
  Re: Bug in Compute_Axis_Rotation_Transform()  
From: Warp
Date: 3 Jul 2000 17:14:45
Message: <39610245@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
: The type VECTOR is an array of three doubles.

  Well, strictly speaking there's no such a thing as an array in C.
  What is passed to the function is a pointer-to-double. This pointer points
to a memory location containing one (or more) double-type values. There's
no way of knowing whether the pointer points to just one double or to a
series of them, and if the latter, how many of them. You just have to trust.
  There is a pass-by-value parameter here, so the value is copied for the
function. But since the value is just a pointer, it will point to the same
place as the original one.

  Even a local "array" (like this:

void f(void)
{ double array_of_doubles[3];
}

) is not really an array, but just a pointer to a static memory location
which (ie. the pointer) can't be modified.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.