How can you...

This is a discussion on How can you... within the C Programming forums, part of the General Programming Boards category; Make a copy of what is in a stack. No not copy the pointer. But i mean actually copy everything ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    34

    How can you...

    Make a copy of what is in a stack.
    No not copy the pointer.
    But i mean actually copy everything in a stack to another stack minus the same pointer locations. All while not altering the original stack.

    Thanks

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,671
    Show us your stack, and how you've implemented push and pop

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    You might want to take a look at memcpy, memmove, memset

    http://www.dinkumware.com/htm_cl/string.html#memcpy

    --Garfield
    1978 Silver Anniversary Corvette

  4. #4
    Sayeh
    Guest
    The stack is just a consecutive list of longs... very easy to copy.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21