Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the 5 types of inheritance in c ++?

1027


write a program to generate address labels using structures?

4585


Explain the advantages of using macro in c language?

1006


Explain how can you be sure that a program follows the ansi c standard?

1481


What does typeof return in c?

1106


What are the types of functions in c?

990


Do you have any idea about the use of "auto" keyword?

1092


What is pass by value in c?

1074


What are the 5 data types?

1145


When should I declare a function?

1148


How to Throw some light on the splay trees?

1066


Explain what is the stack?

1110


What is && in c programming?

1173


What is a lookup table in c?

1124


What does the format %10.2 mean when included in a printf statement?

1659