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
activate the windows screensaver(Visual Basic)
Pop up window(Javascript)
Does a file exist(Powershell)
vertical scroller(Javascript)
Operating System displayed in an excel table(VBScript)
unload all forms(VB)
list disk drive information in an excel spreadsheet(VBScript)
Display all available drives(ASP)

    




Copyright © 2003 by programmershelp.co.uk