News for hackers. Stuff that matters.

Ask HN: How does “min” and “hour” get their values in this C++ code?

https://imgur.com/a/UCks0vq

Full code here:

    #include<iostream>
    using namespace std;
    
    
    class Time
    {
    public:
        int hour;
        int min;
        Time()
        {
            hour=min=0;
        }
        Time(int h,int m)
        {
    
            hour=h;
            min=m;
        }
        Time add (Time t)
        {
            Time t1;
            int m=min+t.min;
            t1.hour=hour+t.hour+m/60;
            t1.min=m%60;
            return t1;
    
        }
    };
    
    int main()
    {
        Time t1;
        Time t2(8,40);
        Time t3(5,30);
        t1=t2.add(t3);
        cout<<t1.hour<<" "<<t1.min;
        return 0;
    }
    


As shown in the figure above, some of my confusions are clear. But what I fail to understand is how "min" and "hour" gets its value from t2(8,40). I am sorry if this is a too basic question, but I didn't understand so I am asking. If I am missing any prerequisites to this topic, do tell me about them, that'd help me more for self learning.
( 7 comments | on HN )
Re:Ask HN: How does “min” and “hour” get their values in thi... by bunbun69 on Thursday March 30, 2023 @05:50AM (#35370251)
I have no clue what this post is doing here.
Re:Ask HN: How does “min” and “hour” get their values in thi... by popcalc on Thursday March 30, 2023 @06:20AM (#35370473)
Yesterday I had an "AI researcher" at Ericsson ask me if I could teach him "how to code". HN, like tech in general has recently had a bunch of hustlers who would otherwise be selling you timeshares jump along for the hype train. I'm trying to find an explanation for the recent spike in posts like OP that lack an understanding of the site/community's etiquette.
Re:Ask HN: How does “min” and “hour” get their values in thi... by shivajikobardan on Thursday March 30, 2023 @08:59AM (#35371965)
are programming questions not allowed in hn?
Re:Ask HN: How does “min” and “hour” get their values in thi... by bunbun69 on Wednesday April 05, 2023 @06:53AM (#35452047)
It's very low effort, StackOverflow and Reddit will probably delete the question as well
Re:Ask HN: How does “min” and “hour” get their values in thi... by pestatije on Thursday March 30, 2023 @06:11AM (#35370409)
stackoverflow is your friend
Re:Ask HN: How does “min” and “hour” get their values in thi... by shivajikobardan on Thursday March 30, 2023 @09:00AM (#35371976)
I don't think SO will like these kinds of questions. It's barely any good for learning concepts unlike HN. Most of stuffs there is rote memorization(related to concepts).
Re:Ask HN: How does “min” and “hour” get their values in thi... by Abby0 on Friday March 31, 2023 @03:44AM (#35383934)
I think the point being is HN isn't not the place to ask for technical help in this manner.