fork download
  1. class Lamp
  2. {
  3. private:
  4. float Pn, Un, U;
  5. public:
  6. float RawP() { return (U * Pn / Un); }
  7. static float operator/(Lamp a, Lamp b);
  8. };
  9.  
  10. float operator/(Lamp a, Lamp b)
  11. {
  12. float tmp;
  13. tmp = a.RawP() / b.RawP();
  14. return tmp;
  15. }
  16.  
  17. int main()
  18. {
  19. float s;
  20. s = Arr[j] / Arr[k];
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7:42: error: ‘static float Lamp::operator/(Lamp, Lamp)’ must be either a non-static member function or a non-member function
     static float operator/(Lamp a, Lamp b);
                                          ^
prog.cpp: In function ‘int main()’:
prog.cpp:20:5: error: ‘Arr’ was not declared in this scope
 s = Arr[j] / Arr[k];
     ^~~
prog.cpp:20:9: error: ‘j’ was not declared in this scope
 s = Arr[j] / Arr[k];
         ^
prog.cpp:20:18: error: ‘k’ was not declared in this scope
 s = Arr[j] / Arr[k];
                  ^
stdout
Standard output is empty