fork download
  1. #include <vector>
  2. #include <cstdlib>
  3.  
  4. using numeric_t = int;//added to resolve type
  5.  
  6. class point_c{};//added to resolve type
  7.  
  8. class cell_c:public point_c {
  9. public:
  10. double p;
  11. std::vector<const cell_c *> NP;// 8 Neighbors Pointer
  12. virtual bool calculateFD(numeric_t & FAe, numeric_t & FAw, numeric_t & FAn, numeric_t & FAs,
  13. numeric_t & DAe, numeric_t & DAw, numeric_t & DAn, numeric_t & DAs) = 0;//pure virtual since its not implemented
  14. cell_c() {
  15. p=0;
  16.  
  17. for(size_t i=0; i!=8; ++i) {
  18.  
  19. NP.push_back(nullptr);
  20. }
  21. }
  22. };
  23.  
  24. class uCell_c:public cell_c {
  25.  
  26. public:
  27. bool calculateFD(numeric_t & FAe, numeric_t & FAw, numeric_t & FAn, numeric_t & FAs,
  28. numeric_t & DAe, numeric_t & DAw, numeric_t & DAn, numeric_t & DAs);
  29. };
  30.  
  31. bool uCell_c::calculateFD(numeric_t & FAe, numeric_t & FAw, numeric_t & FAn, numeric_t & FAs,
  32. numeric_t & DAe, numeric_t & DAw, numeric_t & DAn, numeric_t & DAs) {
  33. FAe=p+NP[0]->p;//p cannot be resolved, why?
  34. return true;//needs to return something
  35. }
  36.  
  37. int main()
  38. {
  39.  
  40. }
  41.  
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty