Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Question about the solidity Structs
6
votes
1
answer
5k
views
Type struct Mycontract.User memory is not implicitly convertible to expected type struct Myc...
pragma solidity >=0.5.0 <0.7.0;
contract Mycontract{
uint256 a;
struct User
{ string name; }
User[] users;
function foo() public{
**User storage user=User("hey");**
users.push …
0
votes
1
answer
36
views
The below code gets compiled but when foo is called invalid opcode error is thrown
pragma solidity >=0.5.0 <0.7.0;
contract Mycontract{
uint256 a;
struct User
{ string name; }
User[] users;
function foo() public{
User storage user=users[0];
user.name= …