<!--
{
  "documentType" : "article",
  "framework" : "quicktime-file-format",
  "identifier" : "/documentation/QuickTime-File-Format/Creating_copying_and_disposing_of_atom_containers",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Creating, copying, and disposing of atom containers"
}
-->

# Creating, copying, and disposing of atom containers

Manage atoms in atom containers.

## Overview

Before you can add atoms to an atom container, you must first create the container by calling `QTNewAtomContainer`. The code sample shown in the following calls `QTNewAtomContainer` to create an atom container.

```c
QTAtomContainer spriteData;
OSErr err
// Create an atom container to hold a sprite’s data.
err=QTNewAtomContainer (&spriteData);
```

When you have finished using an atom container, dispose of it by calling the `QTDisposeAtomContainer` function. The sample code shown in the following listing calls `QTDisposeAtomContainer` to dispose of the `spriteData` atom container.

```c
if (spriteData)
    QTDisposeAtomContainer (spriteData);
```

## Topics

### Managing atoms

[Creating new atoms](/documentation/QuickTime-File-Format/Creating_new_atoms)

Create new atoms and insert them in a QT atom container.

[Copying existing atoms](/documentation/QuickTime-File-Format/Copying_existing_atoms)

Copy existing atoms within an atom container.

[Retrieving atoms from an atom container](/documentation/QuickTime-File-Format/Retrieving_atoms_from_an_atom_container)

Retrieve information about the types of a parent atom’s children, search for a specific atom, and retrieve a leaf atom’s data.

[Modifying atoms](/documentation/QuickTime-File-Format/Modifying_atoms)

Modify attributes or data associated with an atom in an atom container.

[Removing atoms from an atom container](/documentation/QuickTime-File-Format/Removing_atoms_from_an_atom_container)

Remove atoms from an atom container.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)