Need help with a dynamically allocated object inside another class

This is a discussion on Need help with a dynamically allocated object inside another class within the C++ Programming forums, part of the General Programming Boards category; Hi i have wrote a program that creates objects of another class in the class it self, and I want ...

  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
    13,007
    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
    Posts
    5,439
    By 'save', I assume you mean 'save as a file'?
    Code:
    int main(void){srand(time(0));for(double l=rand(),l0=0,l00=0;;l0+=0.1){for(double l000=0;l000
    <1;l000+=.001,l+=((double)rand()/RAND_MAX)/0x64,l00+=((sin(l*0x8*atan(l0)*l000-(l0*0x8*atan
    (l)))*0.5)+0.5)){l00-=floor(l00);for(size_t l0000=0,l00000=(size_t)(0x50*(l00));l0000<l00000;++l0000
    )putchar(0x20);putchar(0x61+(int)((double)rand()/RAND_MAX*0x1a));putchar('\n');}}return 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, 12: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21