On Jan 17, 2:58 pm, "Tomás Ó hÉilidhe" <t...@lavabit.comwrote:
Quote:
Quote:
p = new (void*) [100];
Quote:
Where T is a type:
Quote:
If you want an array of pointers then:
Quote:
If you want a pointer to an array, then:
Not in a new expression. In a new expression, you'd have to put
that in parentheses (i.e. "(T(*)[num])").
More generally, I don't think there's any context in the
language where "(void*)[100]" could be legal. If the [...] is
the subscript operator, then what precedes must be an expression
(and "(void*)" isn't a legal expression). And if the [...] is
meant to be part of a declaration, the only context in a
declaration where (void*) would be legal is as a list of
function parameters, and you can't declare a function to return
an array. (You can declare a function to return a pointer or a
reference to an array, but in this case, it would be something
like:
int (&f(void*))[100] ;
with an extra closing ) in the string.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34