Anyway, You can probably do this using the system command. **broken link removed**
If you using a unix enviroment type 'man system'.
Other than that I'm sure you can do it in much the same way as any other file, just look for some examples using google or read some file I/O manuals for the compiler that you are using.