Inheritance and Memory Allocation

Question:
I can’t create an instance of the derived class using operator new. The base and the derived classes differ only by a virtual function. The error messages I receive at runtime asks me to specify the path for files like:

new.asm, strncpy.asm

Answer:
You didn’t mention what compiler you’re using but it sounds like you’re attempting to step into the implementation code of operator new using Visual C++ debugger. Normally, you don’t need to do that. Simply use the “step over” command to exit from it. Instead, set a break point in constructor of the class whose instance you’re attempting to create.

You should note that many time-critical, low-level functions like memcpy, strncpy, memset etc. are written in assembly. When the compiler sees a call of such a function, it inserts its assembly code inline (rather than actually calling a function). When you try to step into the called function, the debugger needs to know where the assembly source files of these functions are located. You can find them in the Visual C++ installation CD (simply run a search to locate these files and then direct the debugger to look for them on the CD).

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

iOS app development

The Future of iOS App Development: Trends to Watch

When it launched in 2008, the Apple App Store only had 500 apps available. By the first quarter of 2022, the store had about 2.18 million iOS-exclusive apps. Average monthly app releases for the platform reached 34,000 in the first half of 2022, indicating rapid growth in iOS app development.

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a