fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. struct node{
  5. node(int data,node * next):data{data},next{next}{
  6. }
  7. int data;
  8. node *next;
  9.  
  10. };
  11.  
  12. int main(){
  13. node c=node(3,nullptr);
  14. node b=node(2,&c);
  15. node a=node{1,&b};
  16.  
  17.  
  18. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty