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

Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2127


What is array of structure in c programming?

1332


what do you mean by enumeration constant?

1062


State two uses of pointers in C?

1108


Give differences between - new and malloc() , delete and free() ?

1153


When is the “void” keyword used in a function?

1583


What is the use of typedef in structure in c?

1007


Which one would you prefer - a macro or a function?

1134


Why structure is used in c?

1238


What are the salient features of c languages?

1139


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

1131


Write a program for finding factorial of a number.

1143


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1233


How important is structure in life?

1147


How many types of operator or there in c?

1137