#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();

}

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

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

Read the comments in the input function.

Member Avatar for iamthwee

>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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.