Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • c = new Test*[2]; That was my guess as well, but when I tried this, I got a compiler error. Any idea why? Commented Jul 25, 2011 at 3:36
  • How did you have c declared? Test *c or Test **c? Commented Jul 25, 2011 at 3:41
  • @Kshitij, because new Test*[2] returns Test** and type of c is Test*. You should be doing rather new Test[2]. Commented Jul 25, 2011 at 3:42
  • Are you certain? The rules for one-line declarations are often misunderstood, leading to declararions with not enough stars. What error were you getting? Commented Jul 25, 2011 at 3:50
  • @Dave I'll play around with it a little when I have some time, and ask a question on SO with the exact exception if I can't figure it out. Thanks! Commented Jul 25, 2011 at 6:12