swapping of array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hope spirit
    New Member
    • Dec 2010
    • 1

    #1

    swapping of array

    I have 3 arrays A, B and C. i want to sawp these. array B will be initialized by A. now take an element from array C and the index # of B that is according to that element (that we take from C)is swap with the first element of Array B.
    for example
    array A[1, 2, 3, 4, 5]
    B[0, 1, 2, 3, 4] //index # of array B
    array B[1, 2, 3, 4, 5] //initialized by array A
    array C[2, 4, 6, 8, 10]

    now if we take an element 2 from C now the index of B that is equal to this element 2 is taken and swap with the first element of B.
    index # 2 of <-> first element of B that is 1 and also save in array B.

    please any one can help me to make this code. I'll be very thankful to you.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Read this: http://bytes.com/topic/c/insights/77...rrays-revealed.

    Then post again if you still have problems.

    Comment

    Working...