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

Do string constants represent numerical values?

1445


What is pointer & why it is used?

1170


is it possible to create your own header files?

1161


How many types of sorting are there in c?

1111


Why double pointer is used in c?

1087


Why doesnt the call scanf work?

1239


What is quick sort in c?

1151


Explain the term printf() and scanf() used in c language?

1093


Explain how can I pad a string to a known length?

1249


What are the 5 types of organizational structures?

1132


How do you determine whether to use a stream function or a low-level function?

1189


How do I use void main?

1140


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2179


Are global variables static in c?

1212


What is property type c?

1130