fork download
  1. #ifndef FUNCTION04_H_
  2. #define FUNCTION04_H_
  3.  
  4. #include <stdio.h>
  5.  
  6. void sort_by_abs (int array[], int size);
  7.  
  8. int main() {
  9. int size;
  10. scanf("%d", &size);
  11. int array[100000];
  12. for (int i = 0; i < size; i ++) {
  13. scanf("%d", &array[i]);
  14. }
  15. sort_by_abs(array, size);
  16. for (int i = 0; i < size; i ++) {
  17. printf("%d%c", array[i], " \n"[i == size - 1]);
  18. }
  19. return 0;
  20. }
  21. #endif // FUNCTION4_H_
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:10:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &size);
     ^~~~~~~~~~~~~~~~~~
prog.c:13:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &array[i]);
         ^~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /home/OReIGZ/ccNnROtC.o: in function `main':
prog.c:(.text.startup+0x70): undefined reference to `sort_by_abs'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty