You are here:

C++/Char pointer length

Advertisement


Question
Hello.

I would like to know if there are any standard library functions that can get the length of a char* if it has a null character right in the middle of it. strlen() obviously wouldn't help me.

If there aren't any functions for this, how could i go about to solving this?

Thanks,
Ryan

Answer
Hi,
  Which character you have decided to use as the end of your string would define how you write a strlen of your own.
Normally, we say that '\0' is the end of the character string but you could always change this and have a '|' as the end character.

Let me know if you need any help.

Regards,
RaiD

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Dharmender Rai

Expertise

I can answer general and system level C/C++ questions.

Experience

I have 5 years of experience in C++.

©2016 About.com. All rights reserved.