Help to copy Array a into first portion of array b

This is a discussion on Help to copy Array a into first portion of array b within the C Programming forums, part of the General Programming Boards category; I need help with how to copy array a into first portion of array b. Assume double a[11], b[34]. This ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    14

    Help to copy Array a into first portion of array b

    I need help with how to copy array a into first portion of array b. Assume double a[11], b[34].

    This is what I have so far:

    double i = 0;

    a[11];

    b[34 (sizeof (a) ) ];

    do

    {

    b[ i ] = a[ i ]
    itt;
    }
    while ( i < sizeof (a) );
    Anna

  2. #2
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    memcpy() is your friend (well, ok, so is google)
    hello, internet!

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    14
    Thanks for your response but I'm a baby in C Programming -- please explain your reponse in laymans terms.
    Anna

  4. #4
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    memcpy() is the function most appropriate for this situation
    google is the search engine most appropriate for any situation
    hello, internet!

  5. #5
    Registered User
    Join Date
    Oct 2002
    Posts
    14
    Thank you Salem!
    Anna

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. copy array of classes or explicity call constructor
    By Doodle77 in forum C++ Programming
    Replies: 5
    Last Post: 06-10-2007, 12:57 PM
  2. Replies: 2
    Last Post: 04-04-2007, 07:34 PM
  3. Copy multidimensional array to single array?
    By seepox in forum C Programming
    Replies: 9
    Last Post: 05-08-2006, 12:19 PM
  4. copy contents of array to single value?
    By mapunk in forum C Programming
    Replies: 3
    Last Post: 12-02-2005, 09:28 PM
  5. Array Program
    By emmx in forum C Programming
    Replies: 3
    Last Post: 08-31-2003, 01:44 AM

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