Re: CArray
Dymus wrote:
Ok here is sample of code:
CArray <MyClass,MyClass> arr;
MyClass * obj;
obj = new MyClass();
Why not merge the two statements?
obj->some_field=some_value;
arr.Add((*obj));
Why extraneous parentheses?
delete obj;
----
Error 2664 Add cannot convert parameter 1 from class MyClass to class
MyClass.
Where is error?? or what I've missed?
Several things, the most important of which is that this newsgroup
is about C++ langauge, not about MFC. See 'microsoft.public.vc.mfc'
for help on CArray (if it's not MFC, try the newsgroup where it is
relevant), and if it's your own template, provide its definition.
Also, next time you decide to post to a newsgroup for the first time,
use a different approach: first *read* the newsgroup, then find out
where its FAQ is (if any), and read that, and only then, if your
questions haven't been answered, and you figured how to post, do.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask