Writing some stuff to a file

Hi there!
I'm trying to make a program to modify a file automaticly but i'm having some problems. I need to get <?xml version="1.0" encoding="UTF-8" standalone="yes"?> in the file but I have some problems with the "" 's in the file. Please help me :D

1
2
3
4
5
6
7
8
9
10
11
12
#include "stdafx.h"
#include <iostream>
#include <fstream>

using namespace std;
int main(){
ofstream file;
file.open("file.XML");
file << " "; // This -> needs to get in there but there are too many "" any idea how to solve this?<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
file.close();
return 0;
}
Last edited on
Stick a \ before each " that is part of the actual string (i.e. all but the one at the start and the one at the end).
wow thanks :D have been searching for that all day
Topic archived. No new replies allowed.