#include <stdio.h>
#include <stdlib.h>
void read_ints(const char* file_name, int *result);

int main()
{
    int result =0;
    read_ints("numbers.txt", &result);
}

void read_ints (const char* file_name, int *result)
{
  FILE* file = fopen ("numbers.txt", "r");
  int i = 0;
  int n=0; //row number//
  int m;
  int tab[m]; //array//
  if (file == NULL)
  {
   printf("unable to open file %s", file_name);
  }
  while ( fscanf (file, "%d", &i) ==1)
    {
       n++;
      printf ("%d\n ", i);
      *result += i;
      printf("\n we are at row nr. %d sum of this number and all numbers before is: %d\n", n, *result);
       tab[n]==*result;
    }
          printf("\nnumber from row number one is ... : %d\n", tab[1]); //this does not work properly //
  fclose (file);
}