[ create a new paste ] login | about

Link: http://codepad.org/43by6cO7    [ raw code | output | fork ]

C, pasted on Mar 10:
//.h declaration
static vector<string> read_file(string fName);

//.cpp below


vector<string> parser::read_file(string fName)
{
	ifstream myfile(fName);
	string line;
	vector<string> param;
	
	if(myfile.is_open())
	{
		while(std::getline(myfile, line))
			param.push_back(line);
	}


	myfile.close();
	return param;


}


Output:
1
2
Line 2: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
Line 7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token


Create a new paste based on this one


Comments: