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 programing language?
What happens if header file is included twice?
What are the ways to a null pointer can use in c programming language?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What is the purpose of main() function?
List some of the static data structures in C?
Is there a way to compare two structure variables?
Implement bit Array in C.
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
write a c program for swapping two strings using pointer
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?
What Is The Difference Between Null And Void Pointer?
Explain what are multidimensional arrays?
What is || operator and how does it function in a program?
What does *p++ do?