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


write a string copy function routine?

Answers were Sorted based on User's Feedback



write a string copy function routine?..

Answer / vignesh1988i

#include<stdio.h>
#include<conio.h>
void str_cpy(const char *,const char *);
void main()
{
char a[20],b[20];
printf("enter the string for a[] :");
gets(a);
str_cpy(a,b);
printf("\nthe string for b[] is : ");
puts(b);
getch();
}

void str_cpy(const char *a,const char *b)
{
while((*a)^'\0')
{
*b=*a;
*a++;
*b++;
}
*b='\0';
}


thank u

Is This Answer Correct ?    5 Yes 1 No

write a string copy function routine?..

Answer / ragu

if we compile in turbo c its showing error like this
in that above code we cant modify a const object in function str_cpy(const char *a,const char *b)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

what is the differance between pass by reference and pass by value.

7 Answers   Infosys,


to find out the reverse digit of a given number

6 Answers   Infosys, Microsoft, TCS, Wipro,


What is main return c?

0 Answers  


What is call by reference in functions?

1 Answers  


Where static variables are stored in c?

0 Answers  


difference between i++* and *++i

6 Answers   IBM,


what is c

4 Answers  


which of 'arrays' or 'pointers' are faster?

5 Answers  


What is the basic structure of c?

0 Answers  


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

0 Answers  


What is difference between array and structure in c?

0 Answers  


WHOT IS CHAR?

4 Answers   TCS,


Categories