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
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Why should I use standard library functions instead of writing my own?
What is the scope of static variable in c?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
There seem to be a few missing operators ..
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
Can you define which header file to include at compile time?
What are near, far and huge pointers?
Is there a way to jump out of a function or functions?
code for replace tabs with equivalent number of blanks
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
can anyone please tell about the nested interrupts?
Differentiate between a structure and a union.
What does dm mean sexually?