Hi,
I'm quite bad in c++ and i have this weird (for me), problem that i can't work around.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
.....
int main(){
...
int *array1=NULL;
int *buffer=NULL;
size=....;//a certain size comes from function
array1= new int[size];// it looks like both array1 and buffer have only 1 element in them.
buffer= new int[size];//
...
file_read(array1,false); //The crazy thing is, when i give static size to the arrays, i can see the array elements but when i send them through this function, the arrays appear on the other side as having 1 element.
This is the part of function where something is wrong.
int file_read(int a[], bool first)
....
while(!myfile.eof())
{
myfile>> a[i];//the first and only element gets a value, other than that, i keeps increasing, the eof is never reached.
i++;
}
...