0
#include <iostream>
#include <fstream.h>
#include <string>
#include <vector>

void input(int, std::string);
void output();
using std::vector;
using std::ofstream;

int main()
{

    std::string filename = "file.txt";

    int number;

    vector<int> tileList();
    std::cin >> number;

    tileList().push_back(number);




  input(tileList(), filename);
    output();


return 0;
}

void input(vector<int> tileList, std::string filename)
{

//vector<int> tileList;  this needs to be erased
ofstream file;
file.open(filename);
//here you need to loop through the tileList vector
//and stick every member of the tileList vector in the file
//file<<vector<int> tileList; this needed to be erased too
file.close();

}

void output()
{

     std::string output[100];

    ifstream file;

	file.open("file.txt");

	file>>output[100];
	std::cout<<output[100]<<std::endl;

	file.close();

}
4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by iamthwee
0

Well, we see unable to work (unable to compile) code sceleton.
What's your problem?

Read the comments in the input function.

0

>Read the comments in the input function.
That is a very poor description in my opinion. When you say 'every member of tileList' is tileList supposed to be a class? If so where is its declaration?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.