All pastes #2053569 Raw Edit

Anonymous

public text v1 · immutable
#2053569 ·published 2011-05-03 18:49 UTC
rendered paste body
Tdata read(tFile fi){
	Tdata t;
	int i=0;
	t.mass = new int[1];
        bool flag = 1;
	while((!feof(fi)) && flag){
		t.mass =(int*)realloc(t.mass,(i+1)*sizeof(int));
		fscanf(fi,"%d",&t.mass[i]);
                if (getc(fi) == '\n') flag = 0;
		i++;
	}
	t.n = i;
	return t;
}