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

  • SEARCH
  • Home
  • 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 6363281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:01:08+00:00 2026-05-25T00:01:08+00:00

Hopefully there is a simple answer to this as it seems a simple question,

  • 0

Hopefully there is a simple answer to this as it seems a simple question, however I have not been able to find any information on this on the interwebs.

In the following code snippet, Visual Studio complains of unreachable code at the line “delete bytes;”

try
{
   memcpy(bytes, other.bytes, count);
}
catch (...)
{
   delete[] bytes;
   throw;
}

Does memcpy not throw exceptions?

  • 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-25T00:01:09+00:00Added an answer on May 25, 2026 at 12:01 am

    No. memcpy is a C function. It doesn’t know about C++ features such as exceptions. (Of course, it’s perfectly legal to use it in C++, although arguably not the best idea).

    In response to karlphillip: I must indeed clarify my thoughts: in C++, memcpy should be used only for low-level buffer copies inside object private implementation. It shouldn’t be used as mundanely as it was in C (for example to copy numbers arrays) because plain-vanilla buffers are now usually hidden inside class implementations. Classes that wrap arrays or other large amount of data (such as std::array) expose methods to manipulate their contents. And by the time I write this, Mark Ransom nicely summarized it 😉

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

Sidebar

Related Questions

Hopefully this question has a simple answer i'm overlooking! I have an IIS webserver
I have a simple question, and hopefully there is a simple answer . .
I am not sure if there's an answer for this already -- couldn't find
New to git, so this is hopefully a simple question with a simple answer.
Hopefully a question with a very simple answer, but it's not one that I've
Hopefully this'll be a fairly simple answer, but it's not the easiest thing to
I'm new to jQuery so hopefully there is an easy answer to this. I
Hopefully the answer is no, but are there any problems with using Request.Params instead
Hopefully someone here might have an answer to my question. I have a basic
Hopefully this should be an easy answer for someone out there (and possibly a

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.