fork(17) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class test1 {
  5. char name[40] = "Standard";
  6. public:
  7. void display() { cout << name << endl; }
  8. };
  9.  
  10. class test2 {
  11. char name[40];
  12. public:
  13. test2() : name("Standard") {};
  14. void display() { cout << name << endl; }
  15. };
  16.  
  17. int main() {
  18. test1 foo;
  19. test2 bar;
  20.  
  21.  
  22. foo.display();
  23. bar.display();
  24. return 0;
  25. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
Standard
Standard