Having a hard time trying to understand this, can you figure it out?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 2

Having a hard time trying to understand this, can you figure it out??

What is the output of this code? And why? char str[] = "%d %c", arr[] = "Sololearn"; printf(str, 0[arr], 2[arr + 3]);

30th Aug 2020, 1:30 PM
Gujjula Pradeep Reddy
Gujjula Pradeep Reddy - avatar
1 Resposta
+ 6
the first char array str has the formatting in it, and the second arr is having a string "Sololearn when the printf() is executed 0[arr] is equal to *(arr+0) which is 'S' and as the str[] has %d so it returns ascii value of 'S' which is 83 2[arr +3] is equal to *(arr+5) which takes the char value 'e' So it returns output as : 83 e
30th Aug 2020, 1:39 PM
–ú–≥. –ö–Ĺ–į–ŅūüƆ
–ú–≥. –ö–Ĺ–į–ŅūüƆ - avatar