Program to illustrates strlen( ) function


#include <iostream.h>
#include <conio.h>
#include <string.h>          
void main( )
{
                     char s[ ] = "Hello";
cout<<" strlen ( "<<s<<" ) = "<<strlen(s) <<endl;
cout<<" strlen ( \"\" ) = "<<strlen("") <<endl;
char buff[20];
cout<<"Enter String : " ;
cin>>buff;
cout<<" strlen ( "<<buff <<" ) = "<<strlen(buff) <<endl;
getch( );              
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|