Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- draft
- */
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- #include <string>
- using namespace std;
- const int ROWS = 15;
- const int COLS = 30;
- const char EMPTY = '*';
- const char TAKEN = '#';
- void loadSeats(char[ROWS][COLS]);
- int main()
- {
- char seats[ROWS][COLS];
- loadSeats(seats);
- return 0;
- }
- void loadSeats(char seats[ROWS][COLS])
- {
- char seatingChart[ROWS][COLS];
- string fileName = "seatingChart.dat";
- ifstream inFile;
- inFile.open(fileName);
- if (inFile)
- {
- for (int x = 0; x < ROWS; x++)
- for (int y = 0; y < COLS; y++)
- {
- inFile >> seatingChart[x][y];
- }
- inFile.close();
- }
- else
- {
- cout << "Could not fine seatingChart.dat creating new file." << endl;
- ofstream outFile;
- outFile.open(fileName);
- //seatingChart[ROWS][COLS] = EMPTY;
- for (int x = 0; x < ROWS; x++)
- for (int y = 0; y < COLS; y++)
- outFile << seatingChart[x][y];
- //outFile << seatingChart[][y];
- outFile.close();
- }
- cout << "end";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement