Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: Beginner
Oct 25, 1999

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).

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap