Thread: String overwrites every string in linked list

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    7

    Exclamation String overwrites every string in linked list

    removed
    Last edited by SkidMarkz; 09-12-2008 at 09:10 AM. Reason: school assignment

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Because this line:
    Code:
    new_node->make = make;
    does not, and never has, copied a string from one place to another. If you wish to copy a string from one place to another, you must use the string copy function strcpy.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 03-03-2006, 02:11 AM
  2. How can I traverse a huffman tree
    By carrja99 in forum C++ Programming
    Replies: 3
    Last Post: 04-28-2003, 05:46 PM
  3. Linked List
    By jpipitone in forum C Programming
    Replies: 4
    Last Post: 03-30-2003, 09:27 PM
  4. Adding To The Middle Of A Linked List
    By LostNotFound in forum C++ Programming
    Replies: 1
    Last Post: 02-23-2003, 06:02 PM
  5. Template Class for Linked List
    By pecymanski in forum C++ Programming
    Replies: 2
    Last Post: 12-04-2001, 09:07 PM

Tags for this Thread