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;
}
}
Asked
Active
Viewed 203 times
-1
-
there is no difference between them in solidity. – TLHBM May 31 '19 at 11:44
-
hey, suggest some materials to start creating contracts in solidity – Amarnath May 31 '19 at 11:55
-
I recommend https://solidity.readthedocs.io/en/v0.5.9/. – TLHBM May 31 '19 at 12:00
1 Answers
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