Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Length of a string
 

 

 

Description

This example uses the strlen function to find out how many characters are in a string .

Code


#include <stdio.h>
#include <string.h>

int main()
{
char title[] = "Programmers help : C section.";
int characters;
/*get the amount of characters*/
characters = strlen(title);
printf("%s has %d characters.\n", title,characters);
return 0;
}

Information

tested using LCC Win 32

 

 

 

 

Download

strlen.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
File Details(ASP)
source code viewer(C Sharp)
Select Case example(ASP)
open an excel spreadsheet(VBScript)
Ping with VB(VB)
Check when a process stops running(Powershell)
Odd or Even(ASP)
Drawing example(ASP.net)

    




Copyright © 2003 by programmershelp.co.uk