Thread: Need help with a dynamically allocated object inside another class

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    48

    Need help with a dynamically allocated object inside another class

    Hi


    i have wrote a program that creates objects of another class in the class it self, and I want to be able to save data to the objects I have created, from the class that created them. How can I do this?

    THank You

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The same way you would do it anywhere else -- using the methods of the class that you created. (Perhaps you put parameters in the constructor, perhaps using setThis, or setThat, or whatever.)

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    By 'save', I assume you mean 'save as a file'?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  2. Using bitset class inside another
    By Dhekke in forum C++ Programming
    Replies: 3
    Last Post: 07-26-2005, 06:50 AM
  3. Replies: 3
    Last Post: 12-03-2001, 01:45 PM
  4. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 01:26 PM
  5. Replies: 4
    Last Post: 09-12-2001, 02:05 PM