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 | 1 No |
Post New Answer View All Answers
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
How can I use a preprocessorif expression to ?
hi any body pls give me company name interview conduct "c" language only
Are pointers really faster than arrays?
Explain what is the most efficient way to store flag values?
What oops means?
What are the advantages of c preprocessor?
Write a program to swap two numbers without using third variable?
What is the role of this pointer?
What is dangling pointer in c?
What is FIFO?
Explain how does free() know explain how much memory to release?
How will you write a code for accessing the length of an array without assigning it to another variable?
Is Exception handling possible in c language?
What is a structure and why it is used?