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...

code for copying two strings with out strcpy() function.

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
void str_cpy(char *,char *);
void main()
{
char a[30],b[20];
printf("enter the string to be copied :");
gets(b);
str_cpy(a,b);
printf("the final string is :");
puts(a);
getch();
}
void str_cpy(char *a,char *b)
{
if(*b!='\0')
{
*a=*b;
str_cpy(++a,++b);
}
*a='\0';
}

thank u

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

1079


What is the difference between array and structure in c?

1085


the question is that what you have been doing all these periods (one year gap)

2017


what is the structure pointer?

2081


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1018


How can you access memory located at a certain address?

1062


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1087


What are the different properties of variable number of arguments?

1103


What happens if a header file is included twice?

985


What are the advantage of c language?

1004


What is graph in c?

1008


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

1035


What standard functions are available to manipulate strings?

1075


What is an array? What the different types of arrays in c?

1104


to find the closest pair

2288