4/1/2020 6:51:43 AM
asha malla so what we can use instead of %s so that it take only till maximum defined size of array.
And, then why we define the maximum size of array if it has no use🤔
Here when you use %s or gets or puts, these work on pointers. They take variable or array as pointer. So, it doesn't care about what size you mentioned in declaring array. So, it prints everything which is given as input.
Or you can use while or do-while loop too.
Then we can use a for loop and access specifier %c or get() or put() and iterate till your size of array. It takes one character at a time.
GET THE FREE APP
Learn Playing. Play Learning
Send us a message