19780408
Civil/Environmental
- Oct 29, 2006
- 1
Hi friends,
I am new to C++ programming. So please help me for my problems.
I have two data files. Both have ID with some different data.
My program should read a ID in first file then it should read second file corresponding to that ID and print it out.
I tried in following way but it didnt work. Pls help me to improve my program.
while(getline(input1, buff)) {
istringstream tmp(buff);
int a, b;
tmp >> a >> b;
while(getline(input2, buff)) {
istringstream tmp(buff);
int x, y, z;
tmp >> x >> y >> z;
if (a==x) {
output << x << " " << y << " " << z << endl;
cout << x << " " << y << " " << z << endl;
}
}
}
I am new to C++ programming. So please help me for my problems.
I have two data files. Both have ID with some different data.
My program should read a ID in first file then it should read second file corresponding to that ID and print it out.
I tried in following way but it didnt work. Pls help me to improve my program.
while(getline(input1, buff)) {
istringstream tmp(buff);
int a, b;
tmp >> a >> b;
while(getline(input2, buff)) {
istringstream tmp(buff);
int x, y, z;
tmp >> x >> y >> z;
if (a==x) {
output << x << " " << y << " " << z << endl;
cout << x << " " << y << " " << z << endl;
}
}
}