fork download
  1. class MyArray {
  2.  
  3. private:
  4. double* array = nullptr;
  5. int a = 0;
  6. public:
  7.  
  8. MyArray(int size) ;
  9. ~MyArray() { delete[] this->array; }
  10.  
  11. void set_Array(int index, double wert);
  12. double get_Array(int index);
  13. double length_vektor();
  14. void print();
  15. double* operator * (double lambda);
  16. double* operator + (MyArray& arr);
  17. double operator[]( int index);
  18. };
  19.  
  20. #include <iostream>
  21.  
  22. double f (double x_stelle);
  23. MyArray gradient (MyArray x_vektor,double(*f_ptr)(double x_stelle));
  24.  
  25. MyArray gradient(MyArray x_vektor, double(*f_ptr)(double x_stelle)) {
  26.  
  27. double h = 10 ^ (-8);
  28.  
  29.  
  30. //TODO
  31.  
  32. return x_vektor;
  33. }
  34.  
  35.  
  36. double f(double x_stelle) {
  37.  
  38. double summ = 0.0;
  39.  
  40. summ = summ * summ;
  41.  
  42. return summ;
  43. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty