Thread: Insert value into array

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    C noobie
    Join Date
    Jun 2006
    Location
    MI
    Posts
    25

    Insert value into array

    I was curious what the most effective way was for inserting a value into an array. I literally mean inserting a value into an array, as in between two values, not just replacing an item at a specific index. Example,

    psuedoish code,
    Code:
    example[4] = {1,2,3,4};
    insert(9,2,example);
    example[4] == {1,2,9,3};

    I need to insert several large strings into an array several thousand characters long. (similar to how a text editor would do it)
    Last edited by Salgat; 02-26-2009 at 08:22 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code: An auto expanding array (or how to use gets() safely).
    By anonytmouse in forum Windows Programming
    Replies: 0
    Last Post: 08-10-2004, 12:13 AM
  2. insert a value into an array! Help
    By letdoit in forum C++ Programming
    Replies: 3
    Last Post: 05-29-2004, 09:41 PM
  3. Merge sort please
    By vasanth in forum C Programming
    Replies: 2
    Last Post: 11-09-2003, 12:09 PM
  4. insert an element i array
    By planet_abhi in forum C Programming
    Replies: 6
    Last Post: 02-22-2003, 07:04 PM
  5. Creating 2D arrays on heap
    By sundeeptuteja in forum C++ Programming
    Replies: 6
    Last Post: 08-16-2002, 11:44 AM