function that creates and returns a 2d array wont work
this is the error im getting(as a note playground\:25:20 continues for every definition of the array): ..\Playground\: In member function 'float* geometry::cube(float, float, float, float, float, float)': ..\Playground\:23:41: error: cannot convert 'float (*)[3]' to 'float' in initialization float _cube = new float[8][3]; ^ ..\Playground\:25:20: error: invalid types 'float[int]' for array subscript _cube[0] = {x, y, z}; and the code: float *cube(float x, float y, float z, float w, float h, float d){ float _cube = new float[8][3]; //i guess the error happens here the rest of the errors are because this didnt work in the first place _cube[0] = {x, y, z}; _cube[1] = {w, y, z}; _cube[2] = {x, h, z}; _cube[3] = {w, h, z}; _cube[4] = {x, y, d}; _cube[5] = {w, y, d}; _cube[6] = {x, h, d}; _cube[7] = {w, h, d}; return _cube; } as an example here is code that works: int *Point(int x, int y, int z){ int *_point = new int[3]; _point[0] = x; _point[1] = y; _point[2] = z; return _point; } in the main function i want to be able to do float *cube1 = cube(1, 2, 3, 4, 5, 6); then access cube1[0][0]; which would return 1 sorry if this is to much to read i just think all the info i presented is atleast somewhat necessary.