+ 2

Structure Structure

This is a quiz question. Can someone explain how the answer is ā€œSololearn9ā€. The quiz is below: struct xyz { char *n; int eos; }; struct xyz x = {ā€œSololearnā€, 2018}: struct xyz y = x; printf(ā€œ%dā€, printf(ā€œ%sā€, y.n)); Thanks

18th Sep 2020, 2:12 AM
Joe Bosah
1 Answer
+ 3
Hello. printf() return the number of characters writed so printf(ā€œ%sā€, y.n) write the word "Sololearn" and the number of characters writed are passed as the argument for the printf("%d"). Have a nice day. 😁
18th Sep 2020, 3:31 AM
Benjamin Alejandro Luna
Benjamin Alejandro Luna - avatar