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 |
hello everybody can we change a the adress of a variabl i mean can i put for exemple for a int *p: &p=6 ?????????
Where are the auto variables stored?
Write a code on reverse string and its complexity.
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
how to write a prog in c to convert decimal number into binary by using recursen function,
c programming of binary addition of two binary numbers
Explain how can you restore a redirected standard stream?
main() { int i,n=010; int sum=0; for(i=1;i<=n;i++) {s=s+i; } printf("%d",&s); getch(); }
What is a class?
main() { int i; printf("%d",((i=1)*i-- - --i*(i=-3)*i++ + ++i)); } ans is 24 bt how?pls tell smbody............
Is there any restriction in how many arguments printf or scanf function can take? in which file in my c++ compiler i can see the code for implementation of these two functions??
What is the difference between variable declaration and variable definition in c?