-1
contract Student{
    struct stu{
        string name;
        uint age;
        bool tookTest;
    }
    mapping(uint => stu) public studentNames;
    function addStudent (uint ID, string _name, uint _age) {
        studentNames[ID] = stu(_name, _age, false);
    }
    function updateStudent (uint ID) {
        studentNames[ID].tookTest = true;
    }
}
Ho Zong
  • 119
  • 1
  • 2
  • 9
Amarnath
  • 11
  • 1
  • 2

1 Answers1

2

There is no difference between both of that. Generally, developers use it to differentiate global variables and function arguments (variablename for global variable and _variablename for function argument).

If you want to create a smart contract then this BitDegree Solidity Course will be very helpful to you, If you are a beginner.

Then go ahead and take a look at https://solidity.readthedocs.io/en/latest/

Meet Siraja
  • 909
  • 7
  • 16