Thread: copy and generate

  1. #1
    Registered User
    Join Date
    Feb 2019
    Posts
    11

    copy and generate

    Is there a way to create multiple objects by simply renaming the same objects in an array?

  2. #2
    Registered User
    Join Date
    Feb 2019
    Posts
    11
    new and delete?

  3. #3
    Registered User
    Join Date
    Feb 2019
    Posts
    11
    Automatically copy and create objects that you create.
    - CObject Object2 (ObjectOrg);
    - CObject Object3 (ObjectOrg);
    Because I have to make this.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    No, objects in an array don't have individual names in the first place: they are referenced with the array name in combination with an index.

    On the other hand, if you want to copy objects of class type, that would involve the copy constructor or copy assignment operator.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using Copy-on-write For Fast Copy?
    By SMurf in forum Tech Board
    Replies: 7
    Last Post: 01-25-2017, 06:26 AM
  2. Replies: 2
    Last Post: 11-20-2013, 01:34 PM
  3. Replies: 2
    Last Post: 10-13-2013, 07:36 PM
  4. RSA generate key in C
    By homoon in forum C Programming
    Replies: 3
    Last Post: 11-27-2012, 03:00 PM
  5. generate svg
    By stabu in forum C Programming
    Replies: 3
    Last Post: 02-25-2010, 12:42 PM

Tags for this Thread