Simple CArray Question

Does anyone know what is wrong with this code. I can get all the other operations for CArray to work, but the "Add" one  :

I have a class... say MyClass

     CArray<MyClass, int> x;
     MyClass y;


What is wrong with the code above??
(SORRY, only had 11 points to give)

Who is Participating?
chensuConnect With a Mentor Commented:
CArray<MyClass, MyClass &> x;

template< class TYPE, class ARG_TYPE > class CArray : public CObject

ARG_TYPE   Template parameter specifying the argument type used to access objects stored in the array. Often a reference to TYPE. ARG_TYPE is a parameter that is passed to CArray.
huyaAuthor Commented:
Edited text of question
Also make sure MyClass can be assigned (it won't if you simply derive from CObject), example - check this works

MyClass A ;
MyClass B ;

A = B ;

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.