can someone please let me konw what is the error in this code, not getting expected output.
#include<iostream>
using namespace std;
class myclass {
public:
int& num;
myclass(int number) : num(number){}
};
int main(){
int num1= 10000, num2 = 333;
myclass mm(num1);
myclass nn(num2);
cout << mm.num << endl;
cout << nn.num << endl;
return 0;
}