Consider an array arr[10]
of size 10. While getting/displaying data, we use a for loop of the following common syntax
for(int i=0;i<10;i++)
In case of a string, it is like
for(int i=0;strlen(arr)>i;i++)
But I've read somewhere that a simpler expression like arr[i]
could just be used in the place of condition. I've tried running a code with that condition. But I get an error. So is there a similar, simple condition expression that can be used with arrays/string?