Question about malloc and new


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Question about malloc and new

  1. #1
    Join Date
    May 2012
    Posts
    1

    Question about malloc and new

    Hello All,
    I have a question about the KLU library for LU factorization of sparse matrices.

    The KLU library accepts a pointer to a memory allocator function, by default it is malloc().
    Then it uses this pointer to allocate the memory required.

    I want to extend the library and I now have object of classes. I want to use the operator new instead of malloc to allocate the memory. In the same time I want the new operator to call the constructors of the objects.

    Is there a way to do it?

    Thank you
    Mina

  2. #2
    Join Date
    May 2012
    Posts
    1
    when you use new it automatically calls the constructor function.
    http://www.cppbasics.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center