0

I'm trying to make this an array but where I've put the brackets it just gives an error out.

Texture2D* sun = new Texture2D();
0

2 Answers 2

1

You need to do something like this:

Texture2D* sun = new Texture2D[size];

See operator new[].

Sign up to request clarification or add additional context in comments.

2 Comments

I've done this. Texture2D* sun = new Texture2D()[10]; but now I get the error of no suitable conversion function from "Texture2D" to "Texture2D*" exists
Try Texture2D* sun = new Texture2D[10];
0

Maybe you need to do something like this:

Texture2D** sun = new Texture2D*[size];

2 Comments

I've done this. Texture2D* sun = new Texture2D()[10]; but now I get the error of no suitable conversion function from "Texture2D" to "Texture2D*" exists
@RussNicholls You must use my answer or al-Acme answer. not Texture2D()[10];

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.