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...

how to copy a string without using c 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 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c programing language?

1071


Is c language still used?

963


Where are c variables stored in memory?

1054


What is memcpy() function?

1100


Are enumerations really portable?

1012


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1451


Why is this loop always executing once?

1045


What is an endless loop?

1260


how to make a scientific calculater ?

2056


Where in memory are my variables stored?

1168


How many levels of pointers have?

1034


Explain what is the benefit of using enum to declare a constant?

1064


What is sizeof array in c?

1024


What is the meaning of c in c language?

1143


Explain Function Pointer?

1150