Here is my code, i am trying to get file and read it as array so i can make my thing move in the map. Please help me if you know how to thanks alot (:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main (void){
string map1;
ifstream myfile ("basement.txt");
if (myfile.is_open()) //associate and open file
{
while (myfile.good() ) //.good returns true
{
getline (myfile, map1);
cout << map1;
cout << '\n';
}
myfile.close(); //close the file
}
else cout << " Unable to open file";
return 0;
}
Last edited on