Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a string copy function routine?

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


Please Help Members By Posting Answers For Below Questions

What is extern storage class in c?

1000


What is the use of sizeof () in c?

1059


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1473


what is the structure pointer?

2131


What is adt in c programming?

1168


What is the return type of sizeof?

1067


Why does everyone say not to use gets?

1109


What is the mean of function?

1136


What header files do I need in order to define the standard library functions I use?

1063


What is void main () in c?

1214


Explain what is wrong in this statement?

1126


What is the explanation for the dangling pointer in c?

1117


How can I get the current date or time of day in a c program?

1228


Why is it important to memset a variable, immediately after allocating memory to it ?

2078


How to get string length of given string in c?

1067