fork(1) download
  1. #include <vector>
  2.  
  3. class MyClass{
  4. private:
  5. int a;
  6. std::vector<int> test;
  7. public:
  8. MyClass();
  9. void add(int n);
  10. };
  11.  
  12. MyClass::MyClass(){
  13. }
  14.  
  15. void MyClass::add(int m){
  16. //unable to resolve identifier push_back
  17. test.push_back(m);
  18. }
  19.  
  20. int main() {
  21.  
  22. MyClass a;
  23. //request for member add in a which is of non class type
  24. a.add(1);
  25.  
  26.  
  27. }
Success #stdin #stdout 0s 4392KB
stdin
Standard input is empty
stdout
Standard output is empty