fork download
#include <iostream>
#include <cstdio>
 
using namespace std;
 
class Hello{
    public:
    Hello(int n)
    {
        printf("CTOR\n");
    }
    
    Hello& operator=(Hello& h)
    {
        printf("assignment\n");
        return *this;
    }
};
 
int main() {
        
    printf("first:\n");
    Hello firstHello(3);
    
    printf("\nsecond:\n");
    Hello secondHello = Hello(4);
    
    return 0;
}
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
first:
CTOR

second:
CTOR