Questions tagged [strlen]

A standard C function that returns the length of a string.

This function calculates the length of the string, excluding the terminating null byte \0. It is defined in the <string.h> standard header.

Documentation for C strlen.

692 questions
-7
votes
1 answer

Strlen returns undefined behaviour with C++

int main () { char* tab=new char[14] ; cout << " lenght with sizeof: "<
xtensa1408
  • 584
  • 12
  • 32
-7
votes
3 answers

Checking string length with strlen

I have this code, i want it to check if the length is NOT 32 or 40. The code below only checks if the word is 32 or 40 in length.
1 2 3
46
47