Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main() {
- string class1 = "Warrior";
- string class2 = "Mage";
- string class3 = "Thief";
- ofstream file;
- file.open("classes.txt", ios::out);
- // Write the value for class1 which is "Warrior" to the file
- file << class1;
- // Do the same for class2 "Mage"
- file << class2;
- // and last for class3 "Thief"
- file << class3;
- // Remember to close the file
- file.close();
- // This method must return something.
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement