fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class cb{
  5. private:
  6. int v1;
  7. int v2;
  8.  
  9. cb(){}
  10.  
  11. cb(int n1,int n2){
  12.  
  13. v1=n1;
  14. v2=n2;
  15.  
  16.  
  17. }
  18.  
  19. void fs(){
  20.  
  21. cout<<v1<<" ";
  22. cout<<v2<<"\n";
  23.  
  24.  
  25.  
  26. }
  27.  
  28.  
  29.  
  30.  
  31. };
  32.  
  33.  
  34. class cd : cb{
  35.  
  36. private:
  37. int v3;
  38.  
  39. public:
  40. cd(int n3){
  41.  
  42. v3=n3;
  43.  
  44. }
  45.  
  46. void fscd(){
  47.  
  48. cout<<v3<<"\n";
  49.  
  50. }
  51.  
  52.  
  53.  
  54. };
  55.  
  56.  
  57.  
  58.  
  59. int main() {
  60. // your code goes here
  61. return 0;
  62. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor ‘cd::cd(int)’:
prog.cpp:40:12: error: ‘cb::cb()’ is private within this context
  cd(int n3){
            ^
prog.cpp:9:2: note: declared private here
  cb(){}
  ^~
stdout
Standard output is empty