Hi guys:
I created this code to read two file get their input and post certain output. My problem is that C++ is sorting out my output from smaller to greater. Is there a way that I can get c++ not to sort out the output.
Thanks:
Gus
Here is my code
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main()
{
char cmpFile[20];
int numberRaw=10;
int numberImages = 100;
ifstream in,in2;
in.open("stars.comp");
in2.open("go.comp");
ofstream out("basura.comp");
double ierr,serr,verr,isn,iln,vn,x,y,sharp;
vector<double> rawStar(numberImages);
vector<double> idil(numberImages);
vector<double> idis(numberImages);
vector<double> idv(numberImages);
vector<double> idile(numberImages);
vector<double> idise(numberImages);
vector<double> idve(numberImages);
vector<double> stardId(numberRaw);
for(int j=0;j<numberImages;j++)
{
in >>idil[j]>>idile[j]>>idv[j]>>idve[j]>>rawStar[j]>>sharp;
for (int i=0; i<numberRaw; i++)
{
in2 >>stardId[i];
if (stardId[i]==rawStar[j])
{
out <<" "<<idil[j]<<" "<<idile[j]<<" "<<idv[j]<<" "<<idve[j]<<" "<<rawStar[j]<<" must be equal to "<<stardId[i]<<endl;
// cout << rawStar[j] << " " << stardId[i];
}
}
}
out << endl;
return 0;
}