PDA

Click to See Complete Forum and Search --> : Problem with string in copy constructor?


NOMADMAN
May 28th, 2002, 06:03 PM
I have a class with only a string and a bool data type. In the copy constructor it says:

name = v.name;
marked = v.marked;

(name is the string and marked is the bool, v is var from copy constructor)

When I run the program it works except when I get to a part that would normally call the copy constructor, I error and goto the debugger. In the debugger it points to windows code, and says its in the assign function of string.h. I can't understand whats going on or try. But when I look to see what called the assign in string.h its my copy constructor (above)...

Anyway, anyone else had this problem or maybe a solution for me to try?

Thanks!
NOMAD

CornedBee
May 31st, 2002, 02:35 AM
It seems that the strings in v are invalid, causing the string assign operator to assert.