Solved

Simple CArray Question

Posted on 1998-08-19
3
233 Views
Last Modified: 2013-11-20
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;

     x.Add(y);

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


0
Comment
Question by:huya
3 Comments
 

Author Comment

by:huya
ID: 1321029
Edited text of question
0
 
LVL 23

Accepted Solution

by:
chensu earned 10 total points
ID: 1321030
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.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1321031
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 ;


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 137
repeateFront java challenge 31 95
How to determine file rename from EventLog ? 2 57
firstChar challenge 13 131
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question