Program -
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
void copy
(char*,char*);
char* s1="hello";
char s2[10];
copy(s2,s1);
cout<<s2;
getch();
}
void
copy(char*d,char*s)
{
while(*s)
{
*d++=*s++;
}
*d='\0';
}
Output -
Hello
0 comments:
Post a Comment