Reverse string

hai all,

may any one know how to find the length of the string without using strlen functions and temporary variable.........


  • What do you mean with "temporary variable"? You will need some sort of variable. The most efficient way is this:

    [code]int length;

    for(length=0; str[length] != ''; length++)

    It can also be done through pointers but it won't be as efficient.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion