Results 1 to 2 of 2

Thread: Problem with string in copy constructor?

  1. #1
    NOMADMAN
    Guest

    Problem with string in copy constructor?

    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

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    It seems that the strings in v are invalid, causing the string assign operator to assert.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width