codedamn

Struct

Created by Kshitij about a year ago

0

No description provided

10 Comments

    0

    why cant just directly assign the value of rollno and name in the function just like you did in the constructor ?

    @ladeed

    Muhammed Ladeed

    @ladeed

    0

    This content was deleted by the author

    @felixjosep0198

    Felix Joseph

    @felixjosep0198

    0

    great lession

    @nio

    Nio

    @nio

    0

    When we create a structure inside the contract then do we need to specify the memory keyword if we are using string data type in structure?

    @pritamchougale

    Pritam Chougale

    @pritamchougale

    0

    Last half video was imo unnecessarily complicated. You could have shown different ways of initializing structs in a different function, yet not only you are completely introducing a new way to initialize a struct out of nowhere, you are also instantiating a new struct in memory (instead of just reassigning t.roll and t.name), which is a waste of gas and bad practice. Even when teaching basic concepts, one shouldn't go for bad practices.

    @egoceyo0595

    egoceyo

    @egoceyo0595

    0

    The last part was so confusing

    @aniket0904

    Aniket

    @aniket0904

    0

    solidity has similarities with cpp 😯

    @sourinmust0309

    Sourin

    @sourinmust0309

    0

    If we want to the variables create and accept data from user for more than 1 variable do we need to create more function or we can do in 1 functions itself? For e.g. you created a variable s1 and if want to create s2 also. So to accept the arguments from user for the s2 variable do I need to create a separate function for that?

    Kshitij Please explain how we can create an s2 variables and more. It's not possible with constructors as we can only have one. So how do to it with functions?

    @priyanshrai

    Priyansh Rai

    @priyanshrai

    0

    I am not able to assign the value of roll no and name in the function just like you did in the constructor. It is showing error if we are using constructor method to assign value in the function.

    ParserError: Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "receive" keyword instead.

    @priyanshrai

    Priyansh Rai

    @priyanshrai

    0

    so struct is a class and rollno and name are objects?

    @guily

    Mehul Ratra

    @guily

Your comment