Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void str_cpy(const char *,const char *);
void main()
{
char a[20],b[20];
printf("enter the string for a[] :");
gets(a);
str_cpy(a,b);
printf("\nthe string for b[] is : ");
puts(b);
getch();
}
void str_cpy(const char *a,const char *b)
{
while((*a)^'\0')
{
*b=*a;
*a++;
*b++;
}
*b='\0';
}
thank u
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is extern storage class in c?
What is the use of sizeof () in c?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
what is the structure pointer?
What is adt in c programming?
What is the return type of sizeof?
Why does everyone say not to use gets?
What is the mean of function?
What header files do I need in order to define the standard library functions I use?
What is void main () in c?
Explain what is wrong in this statement?
What is the explanation for the dangling pointer in c?
How can I get the current date or time of day in a c program?
Why is it important to memset a variable, immediately after allocating memory to it ?
How to get string length of given string in c?