<p>I'm attempting to use TinyXML to read and save from memory, instead of only reading and saving files to disk.</p>

<p>It seems that the documnent's parse function can load a char *. But then I need to save the document to a char * when I'm done with it. Does anyone know about this?</p>

<p><strike>Edit: The printing &amp; streaming functions aren't what I'm looking for. They output in a viewable format, I need the actual xml content.</strike></p>

<p>Edit: Printing is cool.</p>

Don't quite get what you are saying; your question is not clear.  I'm guessing you are wanting to load a file into memory so that you can pass it to the document parse function.  In that case, the following code should work.
```
```
#include <stdio.h>
```
```
The following code reads a file into memory and stores it in a buffer
```
```
FILE* fd = fopen("filename.xml", "rb"); // Read-only mode
int fsize = fseek(fd, 0, SEEK_END); // Get file size
rewind(fd);
char* buffer = (char*)calloc(fsize + 1, sizeof(char));
fread(buffer, fsize, 1, fd);
fclose(fd);
```
```
The file is now in the variable "buffer" and can be passed to whatever function required you to provide a char* buffer of the file to it.