| 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.
.
|
|
|
|

|
Related Articles |
|
|