code for copying two strings with out strcpy() function.
Answer Posted / ankitecian
int main(int argc, char *argv[])
{
char _output[200];
memset(_output,'\0',200);
if(argc < 2)
{
printf("Usage: <%s> <String -1>\n",argv[0]);
return -1;
}
StrCpy(_output,argv[1]);
printf("The Final String is::: \n[%s]\n",_output);
return 0;
}
int StrCpy(char *_output, const char *_input1)
{
int _cntr1 = 0;
while(*(_input1 + _cntr1) != NULL)
{
*(_output + _cntr1) = *(_input1 + _cntr1);
_cntr1++;
}
return 0;
}
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What is page thrashing?
What is c programming structure?
Explain data types & how many data types supported by c?
What is ambagious result in C? explain with an example.
Is there any data type in c with variable size?
What is non linear data structure in c?
Tell me is null always defined as 0(zero)?
about c language
Why c is faster than c++?
What is pointer to pointer in c?
Write a program to swap two numbers without using third variable in c?
Explain what are linked list?
When is the “void” keyword used in a function?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
Explain about the functions strcat() and strcmp()?