How do I typedef pointer to an array of MyClass ?



 DEVELOP > c-Plus-Plus > How do I typedef pointer to an array of MyClass ?

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Subhransu Sahoo"
Date: 18 Oct 2006 04:58:31 AM
Object: How do I typedef pointer to an array of MyClass ?
Hi All,
How do I typedef pointer to an array of MyClass ??
e.g. CMyClass (*x)[] -> i want to write as PtrToMyClassArray x.
Regards,
Sahoo
.

User: "Frederick Gotham"

Title: Re: How do I typedef pointer to an array of MyClass ? 18 Oct 2006 02:54:09 PM
Subhransu Sahoo posted:

Hi All,

How do I typedef pointer to an array of MyClass ??

I'd advise against it, but anywho:
std::size_t const len = 8;
typedef MyClass (*BadType)[len];
--
Frederick Gotham
.

User: "Sumit Rajan"

Title: Re: How do I typedef pointer to an array of MyClass ? 18 Oct 2006 05:13:08 AM
Subhransu Sahoo wrote:

Hi All,

How do I typedef pointer to an array of MyClass ??

e.g. CMyClass (*x)[] -> i want to write as PtrToMyClassArray x.

Not sure if I understand your question correctly. Do you mean that if
you have a class A, you want a typedef for an array of such A's like:
typedef A AArray[4];
AArray arrrr;
Or do you want a typedef to a pointer to a such as:
typedef A* PtrToA;
PtrToA ptrA = new A[4];
delete[] ptrA;
Regards,
Sumit.
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER