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

char *ch = "abcde";
char c[4];
how to copy 'ch' to 'c'?

Answer Posted / gopi

main()
{
char *ch="abcd";
char c[4];

for(int i=0;i<4;i++)
{
c[i]=*ch;
ch++;
}


printf("%s",c);

getch();

}

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain deep copy and a shallow copy?

989


Explain binary search.

943


What are c++ redistributables?

978


Explain the concept of dynamic allocation of memory?

1044


What is the difference between a reference and a pointer?

1046


Why is "using namespace std;" considered bad practice?

1036


What is near, far and huge pointers? How many bytes are occupied by them?

1068


What is pointer to array in c++?

1078


What are the uses of typedef in a program?

1029


What are the c++ access specifiers?

1341


Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.

2525


What is namespace std; and what is consists of?

1220


Will this c++ program execute or not?

1017


What is the difference between strcpy() and strncpy()?

1070


What is the full form of india?

1030