Thanks. It worked. I tried bool SafeArrayAlloc(T&* array, int Size) previously but it did not work. You are probably right that this function is not very useful, but I also wanted to write a function for multidimensional array allocation and I can't do that without getting this function to work. Thanks again.