Click here to Skip to main content
15,915,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to do new CArray??? Pin
PJ Arends18-Mar-07 10:04
professionalPJ Arends18-Mar-07 10:04 
GeneralRe: How to do new CArray??? Pin
Greg Ellis18-Mar-07 10:15
Greg Ellis18-Mar-07 10:15 
GeneralRe: How to do new CArray??? Pin
PJ Arends18-Mar-07 10:30
professionalPJ Arends18-Mar-07 10:30 
GeneralRe: How to do new CArray??? Pin
Greg Ellis18-Mar-07 10:34
Greg Ellis18-Mar-07 10:34 
GeneralRe: How to do new CArray??? Pin
PJ Arends18-Mar-07 10:40
professionalPJ Arends18-Mar-07 10:40 
AnswerRe: How to do new CArray??? Pin
Christian Graus18-Mar-07 10:31
protectorChristian Graus18-Mar-07 10:31 
AnswerRe: How to do new CArray??? Pin
Michael Dunn18-Mar-07 11:11
sitebuilderMichael Dunn18-Mar-07 11:11 
QuestionCopy constructor question (am I doing something stupid here?) Pin
Sean Wcisel18-Mar-07 9:24
Sean Wcisel18-Mar-07 9:24 
Hi guys,

Michael Dunn was kind enough to answer a question I had last night, but now I seem to have hit another nearby snag.

I'm trying to implement a copy constructor as follows:

<br />
Node somenode = new Node();<br />
Node masterArray[40];<br />
.<br />
.        <br />
.<br />
<br />
for (int i = 0; i < 40; i++)<br />
{<br />
.    //do stuff to change the value of someNode<br />
masterArray[i] = new Node(someNode);<br />


and this is my copy constructor (all values are ints, char arrays, etc)

<br />
Node::Node(const Node& n)<br />
{<br />
	name = n.name;<br />
	lChild = n.lChild;<br />
	rChild = n.rChild;<br />
	placed = n.placed;<br />
	arraySpot = n.arraySpot;<br />
	dRPtr = n.dRPtr;<br />
}<br />


When I try to compile, I get errors on all the lines similar to:
<br />
masterArray[i] = new Node(someNode);<br />


that read:

.\BST.cpp(52) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'Node *' (or there is no acceptable conversion)
c:\path 3 files\bst\bst\Node.h(14): could be 'Node &Node::operator =(const Node &)'
while trying to match the argument list '(Node, Node *)'

(verbose, isn't it? Poke tongue | ;-P )

I'll keep digging around for an answer (yes, I did a cursory check of google first), but in the mean time, does anyone have any ideas?

Thanks, as always,
-Sean
AnswerRe: Copy constructor question (am I doing something stupid here?) Pin
PJ Arends18-Mar-07 9:52
professionalPJ Arends18-Mar-07 9:52 
GeneralRe: Copy constructor question (am I doing something stupid here?) Pin
Sean Wcisel18-Mar-07 10:12
Sean Wcisel18-Mar-07 10:12 
GeneralRe: Copy constructor question (am I doing something stupid here?) Pin
PJ Arends18-Mar-07 10:37
professionalPJ Arends18-Mar-07 10:37 
GeneralRe: Copy constructor question (am I doing something stupid here?) Pin
Sean Wcisel18-Mar-07 10:55
Sean Wcisel18-Mar-07 10:55 
AnswerRe: Copy constructor question (am I doing something stupid here?) Pin
Michael Dunn18-Mar-07 11:16
sitebuilderMichael Dunn18-Mar-07 11:16 
GeneralRe: Copy constructor question (am I doing something stupid here?) Pin
Sean Wcisel18-Mar-07 12:25
Sean Wcisel18-Mar-07 12:25 
QuestionRe: Copy constructor question (am I doing something stupid here?) Pin
PJ Arends18-Mar-07 12:37
professionalPJ Arends18-Mar-07 12:37 
AnswerRe: Copy constructor question (am I doing something stupid here?) Pin
Sean Wcisel18-Mar-07 15:40
Sean Wcisel18-Mar-07 15:40 
QuestionButtons and NM_CUSTOMDRAW Pin
Jerry Evans18-Mar-07 9:19
Jerry Evans18-Mar-07 9:19 
AnswerRe: Buttons and NM_CUSTOMDRAW Pin
PJ Arends18-Mar-07 20:44
professionalPJ Arends18-Mar-07 20:44 
GeneralRe: Buttons and NM_CUSTOMDRAW Pin
Jerry Evans19-Mar-07 5:45
Jerry Evans19-Mar-07 5:45 
Questionvideo streaming in handheld devices such as pda Pin
Member 393433118-Mar-07 8:58
Member 393433118-Mar-07 8:58 
Questionohhhhh help me anyone Pin
samozx18-Mar-07 8:53
samozx18-Mar-07 8:53 
AnswerRe: ohhhhh help me anyone Pin
Software_Specialist18-Mar-07 8:58
Software_Specialist18-Mar-07 8:58 
GeneralRe: ohhhhh help me anyone Pin
Sean Wcisel18-Mar-07 9:35
Sean Wcisel18-Mar-07 9:35 
AnswerRe: ohhhhh help me anyone Pin
PJ Arends18-Mar-07 12:01
professionalPJ Arends18-Mar-07 12:01 
AnswerRe: ohhhhh help me anyone Pin
Stephen Hewitt18-Mar-07 12:49
Stephen Hewitt18-Mar-07 12:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.