fork download
  1. #ifndef POINTER09_H_
  2. #define POINTER09_H_
  3. #include <cassert>
  4. #include <cstdio>
  5. #include <cstring>
  6. #include <cstdlib>
  7. #include <algorithm>
  8.  
  9. void sort(int *p[], int n);
  10.  
  11. int main() {
  12. int arr[5000], n, *pointer[5000];
  13. arr[0] = 1;
  14. arr[1] = 3;
  15. arr[2] = 4;
  16. arr[3] = 5;
  17. arr[4] = 2;
  18. pointer[0] = arr;
  19. pointer[1] = arr + 1;
  20. pointer[2] = arr + 2;
  21. pointer[3] = arr + 3;
  22. pointer[4] = arr + 4;
  23. sort(pointer, n);
  24. for(int i = 0; i < n; i++) {
  25. printf("%d", *pointer[i]);
  26. (i < n - 1)? printf(" "):printf("\n");
  27. }
  28. fclose(stdout);
  29. return 0;
  30. }
  31. #endif // POINTER09_H_
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: illegal character: '#'
#ifndef POINTER09_H_
^
Main.java:2: error: illegal character: '#'
#define POINTER09_H_
^
Main.java:3: error: illegal character: '#'
#include <cassert>
^
Main.java:4: error: illegal character: '#'
#include <cstdio>
^
Main.java:5: error: illegal character: '#'
#include <cstring>
^
Main.java:6: error: illegal character: '#'
#include <cstdlib>
^
Main.java:7: error: illegal character: '#'
#include <algorithm>
^
Main.java:11: error: class, interface, or enum expected
int main() {
^
Main.java:13: error: class, interface, or enum expected
  arr[0] = 1;
  ^
Main.java:14: error: class, interface, or enum expected
  arr[1] = 3;
  ^
Main.java:15: error: class, interface, or enum expected
  arr[2] = 4;
  ^
Main.java:16: error: class, interface, or enum expected
  arr[3] = 5;
  ^
Main.java:17: error: class, interface, or enum expected
  arr[4] = 2;
  ^
Main.java:18: error: class, interface, or enum expected
  pointer[0] = arr;
  ^
Main.java:19: error: class, interface, or enum expected
  pointer[1] = arr + 1;
  ^
Main.java:20: error: class, interface, or enum expected
  pointer[2] = arr + 2;
  ^
Main.java:21: error: class, interface, or enum expected
  pointer[3] = arr + 3;
  ^
Main.java:22: error: class, interface, or enum expected
  pointer[4] = arr + 4;
  ^
Main.java:23: error: class, interface, or enum expected
  sort(pointer, n);
  ^
Main.java:24: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:24: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:24: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:26: error: class, interface, or enum expected
    (i < n - 1)? printf(" "):printf("\n");
    ^
Main.java:27: error: class, interface, or enum expected
  }
  ^
Main.java:29: error: class, interface, or enum expected
  return 0;
  ^
Main.java:30: error: class, interface, or enum expected
}
^
Main.java:31: error: illegal character: '#'
#endif // POINTER09_H_
^
27 errors
stdout
Standard output is empty