write a string copy function routine?
Answers were Sorted based on User's Feedback
#include<stdio.h>
#include<conio.h>
void str_cpy(const char *,const char *);
void main()
{
char a[20],b[20];
printf("enter the string for a[] :");
gets(a);
str_cpy(a,b);
printf("\nthe string for b[] is : ");
puts(b);
getch();
}
void str_cpy(const char *a,const char *b)
{
while((*a)^'\0')
{
*b=*a;
*a++;
*b++;
}
*b='\0';
}
thank u
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / ragu
if we compile in turbo c its showing error like this
in that above code we cant modify a const object in function str_cpy(const char *a,const char *b)
Is This Answer Correct ? | 0 Yes | 0 No |
in iso what are the common technological language?
what is c
Why c is known as a mother language?
how can i get the output 54321 4321 321 21 1 in c programming........???? pls help......
What are qualifiers and modifiers c?
What is an auto keyword in c?
Explain what are the advantages and disadvantages of a heap?
In C language, a variable name cannot contain?
two variables are added answer is stored on not for third variable how it is possible?
What does sizeof function do?
#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a==0.5) printf("yes"); else printf("no"); getch(); }
what is the difference between getch() and getchar()?