how to put struct "s1" values in another variable

by Akash Vaid   Last Updated October 09, 2019 10:28 AM

how to put struct "s1" values in another variable.

pragma solidity ^0.5.1;

contract MyContract{
    struct student{
        int RollNo;
        string Name;
    }

    student public s1=student({RollNo:1, Name:"Test Bunny"});

    int public disint; string public disname;
    disint=s1.RollNo;
    disname=s1.Name;
}



Related Questions


Updated January 10, 2019 23:28 PM

Updated January 02, 2019 03:28 AM

Updated May 20, 2019 06:28 AM