of 2
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report

Articles & News Stories


Views: 13 | Pages: 2

Extension: PDF | Download: 0

  /* CH3PR1.C: Program to perform some basic operations on string. */#include <stdio.h#include <conio.h#include <string.hint !strlen char *  $%oid !strcp& char *' char *  $%oid !strcat char *' char *  $int !strcmp char *' char *  $%oid sho( char *  $%oid main )char s1 + , -icit- $char s + , -0agpur- $char s3+ $int len $clrscr  $printf -2ntring s1: 4s-' s1  $len , !strlen s1  $printf -2nlength of the string s1: 4d-' len  $printf -2ntring s: 4s-' s  $!strcp& s3' s1  $printf -2ntring s3 after cop&ing s1 to it: 4s-' s3  $!strcat s3' s  $printf -2ntring s3 after concatenation: 4s-' s3  $if !strcmp s1' s  ,,  printf -2n5he strings s1 and s are similar-  $elseprintf -2n5he strings s1 and s are not similar-  $getch  $6/* finds the length of the string */int !strlen char *s )int l ,  $(hile *s )l77 $s77 $6return l $6/* copies source string s to the target string t */%oid !strcp& char *t' char *s )(hile *s )*t , *s $  t77 $s77 $6*t , 828 $6/* concatenates the t(o strings */%oid !strcat char *t' char *s )(hile *t t77 $(hile *s *t77 , *s77 $*t , 828 $6/* compares t(o strings s and t for e9ualit& */int !strcmp char *s' char *t )(hile *s ,, *t )if  *s  return  $s77 $t77 $6return *s ; *t  $6
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks