Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6107817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:13:47+00:00 2026-05-23T14:13:47+00:00

Basically, I have three arrays, CQueue (2D-array), PQueue (2D-array, the same number of arrays

  • 0

Basically, I have three arrays, CQueue (2D-array), PQueue (2D-array, the same number of arrays as the CQueue, but with each array containing twice as many values) and CC (standard array which is as long as an array in the CQueue). What I want to achieve is taking a specific array in the CQueue, copying it so that CC reads exactly the same as CQueue, and so that the first half of the equivalent array in the PQueue also reads the same.

I’ve been advised to use memcpy by a friend, which seemed fine but hasn’t fixed the problem. I don’t know whether the problem lies within me potentially using memcpy incorrectly or whether there’s another issue at hand. Following is a simplified version of the relevant part of the code.

int (main)
{
  int CQueue[numberOfArrays][halfSize]
  int PQueue[numberOfArrays][size]
  int CC[halfSize]

  for (i = 0; i < numberOfArrays]; i++)
  {
    memcpy (CC, CQueue[i], halfSize)
    memcpy (PQueue[i], CQueue[i], size)
  }
}

Any help offered would be much appreciated, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:13:47+00:00Added an answer on May 23, 2026 at 2:13 pm

    The third argument to memcpy is the amount to copy in characters (i.e. bytes on most platforms). So you need to do something like:

    memcpy(CC, CQueue[i], halfSize*sizeof(*CC));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I have some class objects, each with three properties. Once one class object
Basically my array is nested too deep. It has three sub,sub,sub arrays and I
i have a three arrays in javascript var array1 = new Array (1,2,3,4,5); var
I have an array that can contain any number of elements. Each element contains
basically I have an array of dictionaries and each dictionary has a day ,
I basically have three tables, posts, images and postimages (this simply contains the ids
In our product, we have frames that are basically three inheritance levels down from
I have two arrays. Example of the first array: $arrayOne = array ( 'fruit'
Suppose i have input array byte A[50]; i have put three diffrent data types
I have two arrays they look like $a1 = array( array('num' => 1, 'name'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.