Insertion of an element into array

Discussion in 'C' started by sbvishal, Sep 26, 2007.

  1. sbvishal

    sbvishal New Member

    Joined:
    Jun 20, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I want a code for inserting the element into array either sorted or unsorted.
    Anybody known to this please reply.
    Thanks
    Vishal Singh
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    As you have posted your query in the Introduce yourself forum we by no means can understand what programming language you are asking your question in and so can you share that information.
     
  3. sbvishal

    sbvishal New Member

    Joined:
    Jun 20, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    My query is related to C/C++.
    Thanks for response...
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Moved to C-C++ forum. Also about your query you have 2 options.

    1. You need to shift the elements of the array down and then insert it into place you would like to
    2. Coping the content into new array in 3 parts. First part the original content of the array then the new element and then rest from the original content.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice