Read OnLine Cpp Program Example
8 - STRING | |
---|---|
PRAC 1 | PRAC 2 |
//wap to print fiend string length #include<iostream.h> #include<conio.h> #include<string.h> void main() { int l1,l2; char str1[]="Imacc"; char str2[]="Imacc Education"; clrscr(); l1=strlen(str1); l2=strlen(str2); cout<<"\n First String Length="<<l1); getch(); |
//strcpy() function in c --> //copy content of one string to another #include<iostream.h> #include<conio.h> #include<string.h> void main() { char source[]="Imacc"; strcpy(target,source); cout<<"\n Source String="<<source; getch(); |
Previous | Next |
Download | Download |