+ 2
How does this output comes?😰
I know why does the first output come like this(i.e a : 9). But I won't know how does the second output comes? (i.e b : 18)😅 https://code.sololearn.com/c67TE15mvpNB/?ref=app
4 Respuestas
+ 2
Nasif Rahman thanks😊
But I want to know
what happened on my second output......😅
How does it output b : 18?
When I won't add the null character"\0" at the end...
Can you explain me.....?😅
+ 1
Here is comment from the lesson Nasif Rahman linked ,I am adding it here so others will get an idea of what might be happening,
It is by @Deepak R
printf for string prints till it finds the \0 delimiter. As array is in continuous memory locations, it goes on to the previous variable in the stack ie a, which luckily had \0 termination. Hence the output. As pointed out by others you should also add \0 at the end of vowels and increase the size of vowels to 6
+ 1
Thank you Nasif Rahman 😊
+ 1
Nasif Rahman 😁😄✌👍