+ 1
Please anyone tell me how can we find the length of a string without using strlen??
plz give me the coding for finding the length of. a string! plz
2 Answers
+ 7
You must be knowing a string ends with '\0'. So you could start counting the characters stored in the string until it reaches '\0', that will give you the length of the string.
+ 1
to find the end just use an if else statement in a for loop to check each character until you dont reach \0 , and set another variable as a counter to see how many characters are there