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
What is C language ?
Are there namespaces in c?
What are the 5 types of inheritance in c ++?
How variables are declared in c?
What's the best way of making my program efficient?
Which function in C can be used to append a string to another string?
What is getch() function?
Where we use clrscr in c?
What is a wrapper function in c?
How many identifiers are there in c?
What are identifiers and keywords in c?
provide an example of the Group by clause, when would you use this clause
Write a program to implement queue.
How does pointer work in c?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler