only reserves space for ten doubles, it does not initialize the data! That means the memory still has the contents it had before (maybe some image data, or else - it's not predictable!) and thus the doubles contain more or less random data.

You will have to initialize the data yourself:

@
for(int i=0; i < 10; ++i)
array[i] = 0.0;
@

A better solution would be to use one of Qt's container classes, like [[Doc:QVector]] or [[Doc:QList]]. Those initialize the contents with a default value.

bq. From "Qt Container classes":/doc/qt-4.7/containers.html description:
The documentation of certain container class functions refer to default-constructed values; for example, QVector automatically initializes its items with default-constructed values, and QMap::value() returns a default-constructed value if the specified key isn't in the map. For most value types, this simply means that a value is created using the default constructor (e.g. an empty string for QString). But for primitive types like int and double, as well as for pointer types, the C++ language doesn't specify any initialization; in those cases, Qt's containers automatically initialize the value to 0.