pragma solidity >=0.4.0 <0.7.0;
contract InsanFactory{
struct User{
string name;
address myaddress;
}
mapping(address => User) public userStructs;
address[] public userAddress ;
function createUser(string memory name,address myaddress) public{
userStructs[msg.sender] = name;
//set user name
userStructs[msg.sender] = myaddress;
//address'i degistirdim
userAddress.push(msg.sender);
}
function getResult() external view returns(address[] memory){
return userAddress;
}
}
When I compile this code I got 2 errors:
First error at line 15 says:
Type string memory is not implicitly convertible to expected type struct InsanFactory.User storage ref.
line 15(userStructs[msg.sender] = name;)
Second one at line 17 says:
Type address is not implicitly convertible to expected type struct InsanFactory.User storage ref.
line 17(userStructs[msg.sender] = name;)
What should I do for my error ?