CRYPTO NEWS

How do i add to a nested array within a struct

I am unable to add elements to a array within the struct struct D { string name; address key; } struct Aone { string aid; B[] blist; D[] dlist; } struct B{ string bdesc; bool bstatus; C[] clist; }

struct C{     uint createTime;     string cdesc;     bool rstatus;     string ctype;    } 

mapping(string => Aone) A;

I am need to add items to struct c based on aid provided function rptC(string _aid, string _c) public { B[] storage bhist = A[_aid].blist;

        if(bhist.length > 0 && bhist[bhist.length-1].bstatus==false) {             bhist[bhist.length-1].clist.push(C(now,_c,false,""));         } else if(bhist[bhist.length-1].bstatus==true) {             bhist[bhist.length].clist.push(C(now,_c,false,""));         } else {             bhist[0].clist.push(C(now,_c,false,""));         } } 

I keep getting a invalid json rpc error. I am new to Solidity and need help

Thank you

shelovessavie

#shelovessavie #TheSupremeTeam Artist Name: shelovessavie Who are you? willing to create whatever vibe i’m in and learn to better my craft Where are you from? i grew up mostly in miami then moved to broward. both areas are heavily dominated by rap music. shout out klassmoney for getting me into music fr How can we::Listen

#shelovessavie #TheSupremeTeam
Artist Name: shelovessavie

Who are you?

willing to create whatever vibe i’m in and learn to better my craft

Where are you from?

i grew up mostly in miami then moved to broward. both areas are heavily dominated by rap music. shout out klassmoney for getting me into music fr

How can we follow you?

instagram: @shelovessavie
twitter: @percseller
youtube: shelovessavie
soundcloud: shelovessavie / shelovessavie archive

Song Title: 30 Ball

Listen to shelovessavie:

https://soundcloud.app.goo.gl/WHoxYB48Ze4YfdNt7

Source: https://supremepr.us/

How do i add to a nested array within a struct

Shopping cart
There are no products in the cart!
Continue shopping
0