Thread: Help to copy Array a into first portion of array b

  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
    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
    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, 11:57 AM
  2. Replies: 2
    Last Post: 04-04-2007, 06:34 PM
  3. Copy multidimensional array to single array?
    By seepox in forum C Programming
    Replies: 9
    Last Post: 05-08-2006, 11:19 AM
  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, 12:44 AM