# Copying objects

**URL:** <https://forum.kirupa.com/t/copying-objects/58062>\
**Category:** Uncategorized\
**Created:** [July 19, 2004, 2:23pm UTC](https://forum.kirupa.com/t/copying-objects/58062 "2004-07-19T14:23:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamalik](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@mamalik](https://forum.kirupa.com/u/mamalik)\
**Post date:** [July 19, 2004, 2:23pm UTC](https://forum.kirupa.com/t/copying-objects/58062/1 "2004-07-19T14:23:10Z")

</div>

Hello Guys

[size=2][size=2]I want to know how to copy an object of the same class. Example[/size]

[size=2][/size]

[size=2]var x:new Obj();  
var y:new Obj();[/size]

[size=2]x=y;[/size]

[size=2]  
[/size]

[size=2]The Obj class has an array in it. All other primitives are copied nicely but there are some problems with the array. [/size]

[size=2]I think the pointer is pointing towards the old location even after copying.[/size]

[size=2]Please suggest the best possible way of doing this.[/size]

[size=2]Regards

[/size][/size]
