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 are the 5 types of inheritance in c ++?
write a program to generate address labels using structures?
Explain the advantages of using macro in c language?
Explain how can you be sure that a program follows the ansi c standard?
What does typeof return in c?
What are the types of functions in c?
Do you have any idea about the use of "auto" keyword?
What is pass by value in c?
What are the 5 data types?
When should I declare a function?
How to Throw some light on the splay trees?
Explain what is the stack?
What is && in c programming?
What is a lookup table in c?
What does the format %10.2 mean when included in a printf statement?