Main Menu

HOME

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

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   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
create an xml file(C Sharp)
check a file exists(php)
Detect if media in drive(VB)
read contents of a directory(PHP)
show all rows in a MySQL table(PHP)
Launch a file with associated program(VB)
color changer(Javascript)
display properties using the WMI(C Sharp)

    




Copyright © 2003 by programmershelp.co.uk