Structure Structure | Sololearn: Learn to code for FREE!


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

9/18/2020 2:12:21 AM

Joe Bosah

1 Answer

New Answer


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. 😁