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 4540310
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:04:06+00:00 2026-05-21T15:04:06+00:00

I am trying to overwrite an element (of unknown size) copyHere with newElement, but

  • 0

I am trying to overwrite an element (of unknown size) “copyHere” with newElement, but I am having problems. I set copyHere to the chunk of the elementArr of which I want to overwrite:

void *copyHere = ((char *)elementArray + (i * elementSize));
copyHere = memcpy(copyHere, *newElement, elementSize);

I am getting an error, “invalid use of void expression”. How am I misusing the void * or memcpy? From my understanding, I feed in memcpy a destination block of memory and a source block of memory and the size of the source that I want to copy. I have done this. And for void *copyHere, I have traversed through the elementArray (of unknown type, but known size elementSize) to find the block of memory I want to overwrite. Any clues?

  • 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-21T15:04:06+00:00Added an answer on May 21, 2026 at 3:04 pm

    Remove the * before newElement. You cannot (and do not need to) dereference a void pointer to pass it to memcpy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a div element which shows some text as popup.
I'm trying to overwrite the style of some element of jquery ui, this is
I have a function which grows an array when trying to add an element
I'm having trouble trying to override a form element's onsubmit event. I have no
I'm trying to create an element within a ListView which displays a few TextViews
I'm trying to use the linux sed command to append a path element to
Greetings, I'm trying to override or extend the Element.show() and .hide() methods in mootools
I'm missing some fairly simple syntax I gather. I'm trying to rewrite an element
I'm trying to find the next element with a class of error and hitting
I'm trying to override the standard styling of a listview li element in jquery

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.