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
How the c program is executed?
What is wrong with this program statement?
How do I get a null pointer in my programs?
Explain the difference between call by value and call by reference in c language?
What are the advantages of c language?
What is the heap in c?
how to find anagram without using string functions using only loops in c programming
What is a program flowchart?
What's the total generic pointer type?
What are qualifiers and modifiers c?
What is null pointer in c?
What is enumerated data type in c?
How to throw some light on the b tree?
Explain #pragma statements.
What is void pointers in c?