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

What is c programing language?

1130


What happens if header file is included twice?

1211


What are the ways to a null pointer can use in c programming language?

1193


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2106


What is the purpose of main() function?

1301


List some of the static data structures in C?

1240


Is there a way to compare two structure variables?

1169


Implement bit Array in C.

1193


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1085


write a c program for swapping two strings using pointer

2681


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

1548


What Is The Difference Between Null And Void Pointer?

1328


Explain what are multidimensional arrays?

1120


What is || operator and how does it function in a program?

1157


What does *p++ do?

1068