Storing Doubles in Memory

How can I do this?

void Object::SetValues(double Count ...)
{

va_list values;
this->NumberOfValues=Count;
va_start(values,Count);

for(long long i=0; i<Count; i++) {
this->Values[i] = va_arg(values, double);
std::cout<<this->Values[i]<<" ";
}

va_end(values);
}


Doesn't work.

When I put in: 5, 1, 0, 0, 0, 0

I get: 4.94066e-324, 0, 0, -9.2596e+061, 2.26224e-306

I need floating and not integral types. How can I store and retrieve these in memory?

Count should probably be an integer.

There is an example here -> http://cplusplus.com/reference/clibrary/cstdarg/va_start/

Just to clarify, if you were thinking Count had to be the same type as the variable arguments, then this is not the case. Count is just supposed to be the number of arguments, and hence an integral type.
Topic archived. No new replies allowed.