Advertisement
regzarr

ada lab 0

Feb 21st, 2020
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define CHUNK_SIZE 64
  5.  
  6. unsigned readFile(int **arr, unsigned size) {
  7.     FILE *in = fopen("input.txt", "r");
  8.     size_t i = 0;
  9.     while (fscanf(in, "%d", *arr[i]) == 1) {
  10.         i++;
  11.         if (i % CHUNK_SIZE) {
  12.             *arr = realloc(*arr, size + CHUNK_SIZE);
  13.         }
  14.     }
  15.     fclose(in);
  16. }
  17.  
  18. unsigned countTripletsSum(int *arr, unsigned size, int v) {
  19.     return 0;
  20. }
  21.  
  22. int main() {
  23.  
  24.     printf("hello world!\n");
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement