I was trying to copy a string into another without with my own program
but there is no output on screen -->
Code:#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char * copy(char*s)
{
char *b=malloc(strlen(s));
while(*s!='\0')
{
*b=*s;
s++;
b++;
}
*b='\0';
return b;
}
int main(void)
{
char *a="Hello Tarun";
char *b;
b=copy(a);
puts(b);
return 0;
}