Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ help

Name: Anonymous 2011-11-07 23:46

Don't know if anyone here cares to help, but i couldn't find any answers with searching google.


I want to take the size of two arrays, add them, then dynamically allocate a new one with the size of that sum.

i can't get the new array to work outside of this function.
is there a way to pass it outside of this function?

void sizing(double *f1, double *f2, double *out1, double *out2)
{
    int x,y,z;
    x = (sizeof(f1))/ (sizeof(f1[0]));
    y = (sizeof(f2))/ (sizeof(f2[0]));
    z = x+y;

    *out1 = new double[z];
    *out2 = new double[z];
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List