answersLogoWhite

0

int len = strlen("some string"); // len has value 11

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Find length of the string without using loops and control structures?

length = strlen(string);


How do you find the length of string without using strlen function in MySQL?

SELECT char_length (...) FROM ...


How do you find the length of string without using the strlen function in PHP?

$str = "Hello"; $nameArr=str_split($str); print_r($nameArr); echo "length: ".count($nameArr);


How do you find last char in c string?

(strlen(str) == 0) ? '\0' : str[strlen(str)-1]


Write a prog to find length of string using strlen function?

void main() { char str1[30]; char str2[30]; int len1,len2; printf("Enter string1......:"); gets(str1); printf("Enter string2......:"); gets(str2); len1=strlen(str1); len2=strlen(str2); printf("%s length = %d",str1,len1); printf("%s length = %d",str2,len2); }


Program to find the size of the string in c?

int main (void) { char buf[1024]; scanf ("Enter a string: %s", buf); printf ("The length of the string is %d chars long.\n", strlen (buf)); return 0; }


How you count lentgh of string without using strlen?

Basically in C language string is NULL (0x00) byte ending char array. So in order to find out the length of the string you need to count all elements in array until you reach NULL. But that is what strlen does. There are two links with information about strlen implementation and null-terminated strings.


How can find the length of a string in java without using fun?

Use length() method. Example: "java".length();


Write a program to count the length of a string without using built in functions?

In JavaScript: To find the length of the string we you length method. __ __ __ Click the button to return the number of characters in the string "Hello World!". click here __ __ function myFunction() { var str = "Hello World!"; var n = str.length; document.getElementById("demo").innerHTML = n; } __ __ __ Hope this helps. Thank you


How do you find the perimeter of a jigsaw puzzle using string?

You can find the perimeter of any planar (flat) object using string by wrapping the string around the outside of the object, noting the point on the string where you return to the starting point, and then measuring the length of that portion of the string.


The side lengths of a rectangular room are 6 ft and 8 ft. The room is going to be split in half along the hypotenuse of a triangle using string. Find the length of the piece of string needed.?

Using Pythagoras' theorem the length of the hypotenuse is 10 feet which will be the length of the string needed


Why use length function to find length of primitive data type array object?

There is no length function in C. You may have thought of sizeof or strlen. Perhaps.