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
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
In which layer of the network datastructure format change is done
Lists the benefits of c programming language?
Write a program which returns the first non repetitive character in the string?
How are Structure passing and returning implemented by the complier?
How can I find the modification date and time of a file?
What is the Purpose of 'extern' keyword in a function declaration?
What is the maximum length of an identifier?
What does it mean when a pointer is used in an if statement?
Can variables be declared anywhere in c?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
What is the use of function overloading in C?
What is variables in c?
What is the purpose of void pointer?
What is difference between constant pointer and constant variable?