This example shows string copy with out using library functions.
01
#include<stdio.h>
02
#include<string.h>
03
#include<stdlib.h>
04
05
int
main()
06
{
07
char
*ptr1 =
"BE THE CODER"
;
08
*ptr2;
09
i = 0;
10
11
ptr2=(
*)
malloc
(20);
12
13
while
(ptr1[i] != NULL) {
14
ptr2[i] = ptr1[i];
15
i++;
16
}
17
18
ptr2[i] = NULL;
19
printf
(
"%s\n"
, ptr2);
20
21
getch();
22
return
0;
23
BE THE CODER