how to put struct "s1" values in another variable

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

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


How can I pass struct from one contract to another?

Updated January 10, 2019 23:28 PM

Gas Estimatation

Updated January 02, 2019 03:28 AM