Re: Having issues trying to copy an array



CBFalconer <cbfalconer@xxxxxxxxx> writes:
Tim Woodall wrote:
CBFalconer <cbfalconer@xxxxxxxxx> wrote:
[...]
No they aren't. They are initialized to all bits zero, which is
NOT the same thing.

6.7.8 Initialization

#10 ... If an object that has static storage duration is not initialized
explicitly then:

-- if it has pointer type, it is initialized to a null pointer.

Woops, you may be right here. However, output is not a pointer
type, it is an array type. That provision may not apply, and I
will wait for others to cite C & V.

I already did. C99 6.7.8p10.

--
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: OT: Requesting C advice
    ... some behind the scenes action of the compiler. ... In fact the memory could ... Proper initialization means that floats and doubles must be initialized to 0.0 and pointers must be initialized to the null pointer value, even if those bit patterns differ from all-bits-zero. ...
    (Fedora)
  • Re: Initialization of character array in derived type
    ... In fact, if the array is large enough for the time to be measurable, ... be faster than doing it with static initialization. ... I see that your init-mat_data is a pointer. ... allocate or assign the pointer somewhere. ...
    (comp.lang.fortran)
  • Re: why cant functions return arrays
    ... at initialization. ... I think you don't understand your own compiler. ... but you have not specified how overloading works with arrays unless I ... Pointer + integer ...
    (comp.compilers.lcc)
  • Re: [PATCH 00/11] Task watchers: Introduction
    ... notify_watchers() before any other watchers are called for the new task. ... The use of an array of function pointers can cut ... Within the array a null pointer would mean "don't bother ... to visit all existing tasks and do whatever initialization it needs to ...
    (Linux-Kernel)
  • Re: Using Reference of Pointers
    ... > force initialisation of objects through their static function Create, ... I think hiding a pointer behind a typedef like this ... why not do the initialization in the ctor as C++ ...
    (comp.lang.cpp)