ya...its nice explaination...can we use pointer for nested structure ...also if we are using single pointer..that assigned with address of outer structure..can we access the elements inside nested structure also using the same pointer?
@zaffariqbal36716 жыл бұрын
sir what is the limitation of declaring another structure inside the structure... means how many maximum number of variable of struct type can be declared inside student variable
@stacyhackney61002 жыл бұрын
Thank you
@LearningLad2 жыл бұрын
You're welcome
@pakinam1904 жыл бұрын
Thanks alot
@sait54898 жыл бұрын
sir,is there any difference between defining structure inside/outside main ??
@hukmur37128 жыл бұрын
no difference. ı choose before main.
@pkrdevil11 жыл бұрын
thanks alot. It was nicely explained.
@kuru729 жыл бұрын
Is there a reason why you keep using character arrays in your structs instead of strings?
@LearningLad9 жыл бұрын
kuru72 Strings in C are represented by arrays of characters. There is no specific String datatype. so for strings we have to use character arrays.
@taware7868 жыл бұрын
#include #include int main() { struct studentaddress { char building[25]; int roomno; }; struct studentdata { char name[25]; int rollno; int marks; struct studentaddress addr; }; struct studentdata dee = { "deepak", 50111, 75, "manas", 508 }; printf("name=%s, roll no=%d, marks=%d ", dee.name, dee.rollno, dee.marks); printf("%s ", dee.addr.building); printf("%d ", dee.addr.roomno); return (0); }
@theanger59305 жыл бұрын
Good job!
@LearningLad5 жыл бұрын
thank you :)
@taware7868 жыл бұрын
thanks............
@LearningLad8 жыл бұрын
pleasure :)
@71GA4 жыл бұрын
When are you going to holidays this summer?
@ahmadsolehin9311 жыл бұрын
thx!
@srinijavobugari8008 жыл бұрын
can't it be : anil.addr.sn="mg road" instead of using strcpy function?
@taware7868 жыл бұрын
#include #include int main() { struct studentaddress { char building[25]; int roomno; }; struct studentdata { char name[25]; int rollno; int marks; struct studentaddress addr; }; struct studentdata dee = { "deepak", 50111, 75, "manas", 508 }; printf("name=%s, roll no=%d, marks=%d ", dee.name, dee.rollno, dee.marks); printf("%s ", dee.addr.building); printf("%d ", dee.addr.roomno); return (0); }
@simbu2395 жыл бұрын
my program crashes when i use the above code. it shows process returned -1073741819
@PsSarvna7 жыл бұрын
I think using char sn[]; and char hn[] is simple instead of using this