Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- void saveArray(string* array, int length);
- void saveArray(string* array, int length)
- {
- ofstream File("File.txt");
- for(int i=0;i<length;i++)
- {
- File<<array[i]<<endl;
- }
- }
- int main ()
- {
- string inventory[] = {"Sword", "Armor", "Shield"};
- saveArray(inventory, 4);
- cout << "info saved";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement