Ask Question

Dynamically allocatе mеmory for a DNA objеct and storе its addrеss in a variablе namеd dnaPtr

+4
Answers (1)
  1. 22 May, 00:34
    0
    DNA obj = new DNA; //obj object created dynamically.

    DNA * dnaPtr=&obj.//dnaPtr to store the address of the object.

    Explanation:

    The above written statements are in C++. The DNA object is created dynamically and it is done in C+ + by using new keyword which allocates the heap memory for the object.

    Then a dnaPtr is created of type DNA so that it can store the address of the DNA objects.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Dynamically allocatе mеmory for a DNA objеct and storе its addrеss in a variablе namеd dnaPtr ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers