This is a really simple program I'm writing here but came up to the problem. well, the program fills the array[2000] from the file and then it should TYPE(cout) the array[i] which isn't equal to the second member of array. I am not sure how to point to the second member of array in program. here is the piece of program:
#include <iostream>
#include <fstream>
using namespace std;
const int N=2000;
int main() {
int* array;
array = new int[N];
for (int i=0; i<N; i++){
ifstream ifs("reals.txt");
ifs>>array[i];
}
for (int i=0; i<N; i++){
if(array[i] != array[1]) /// is this right? is array[1] second member?
cout<<array[i]<<'\t';
if((i+1)%13) cout<<endl;
}
system("pause");
return 0;
}
how will it be, if was I wanted to check for the second element from last element of array?
P.S. sorry for my English. if there is anything you can't understand, feel free to comment and I will try to explain. thanks in advance.