About 3,790,000 results
Open links in new tab
  1. C program to find length of string using pointers | ProCoding

    Discover how to find the length of a string in C programming using pointers efficiently. This article provides a step-by-step guide and complete code example, empowering programmers to …

  2. C Program to Print the Length of a String using Pointers

    Dec 5, 2024 · C language provides a built-in function strlen () but in this article, we will learn how to find and print the length of the string using pointers in C. The easiest method to find the …

  3. c - Find the size of a string pointed by a pointer - Stack Overflow

    Nov 25, 2012 · Use strlen to find the length of (number of characters in) a string const char *ptr = "stackoverflow"; size_t length = strlen(ptr); Another minor point, note that ptr is a string literal …

  4. Write a algorithm to find length of string using pointer

    May 29, 2020 · First, we will declare a character string as int main() {char a [100]; into length; Then , we will display a message to the user asking him to enter a string as printf ("Enter a …

  5. C Program: Calculate the length of the string - w3resource

    Mar 19, 2025 · Write a C program to compute the length of a string and then compare it with a user-specified value. Write a C program to find the string length and then reverse the string …

  6. C Program to Find Length of a String Using Pointers - Java Guides

    The function stringLength calculates the length of a given string: - A counter variable length is initialized to zero. - The pointer str is used to traverse the string.

  7. C Program to find Length of a String using Pointer

    Following is the complete C Program to find Length of a String using Pointer: int count = 0; while (*p != '\0') { count++; p++; return count; char str[20] = "OpenGenus"; int length = 0; length = …

  8. Write a C Program to Find Length of String using Pointers

    Dec 1, 2016 · Write a C Program to Find Length of String using Pointers. Here’s simple Program to Find Length of String using Pointers in C Programming Language. What are Pointers? A …

  9. Program to find the length of a string in C, CPP, C Plus Plus with ...

    Mar 3, 2022 · Figure: Output of program for finding the string length. Related Posts: javascript program with a flowchart to find the length of a string with form values entered by the user

  10. Methods to Calculate Length of String in C - Shiksha Online

    Mar 13, 2024 · Here’s an example code snippet that demonstrates how to calculate the length of a string using pointers: len++; ptr++; In the above code, we first declare and initialize a string …

Refresh