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

Returning an array in C++

Name: Anonymous 2009-10-26 20:39

PLEASE /prog/ help me out here. I've read and tested at least 5 "answers" to my question that I've found on google, but I can't get any of them to work. You guys are better than them though, right?

I wanted to call an array by reference in a function. Then, I learned that that was impossible. I tried returning the array, but you can't do that either.

Apparently, I need to do some shit with pointers to return the array. How the fuck do I do this?

Name: Anonymous 2009-10-27 15:18


void *getArray(int length, int bytes)
{
   return new char[length * bytes];
}


NO EXCEPTIONS

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