read multiple files 28 txt 29 c 2b 2b

Solutions on MaxInterview for read multiple files 28 txt 29 c 2b 2b by the best coders in the world

showing results for - "read multiple files 28 txt 29 c 2b 2b"
Clea
20 Nov 2016
1#include <sstream>
2#include <iostream>
3#include <string>
4
5using namespace std;
6int main()
7{
8	string filename;
9	ostringstream ss;
10	filename="data_";
11	for(int i;i<2;i++)
12	{
13	ss << filename << i;
14	FILE * f = fopen (ss.str(), "r");
15			 if (NULL != f)
16			 {
17				 ///.....some work
18			 }
19			 else
20			 printf ("Could not open the file\n");
21	}
22	return 0;
23}